# File lib/www/mechanize/cookie_jar.rb, line 28 def cookies(url) cleanup cookies = [] url.path = '/' if url.path.empty? @jar.each_key do |domain| if url.host =~ /#{CookieJar.strip_port(domain)}$/i @jar[domain].each_key do |name| if url.path =~ /^#{@jar[domain][name].path}/ if @jar[domain][name].expires.nil? cookies << @jar[domain][name] elsif Time.now < @jar[domain][name].expires cookies << @jar[domain][name] end end end end end cookies end