# File lib/mechanize/cookie.rb, line 88 def cookies(url) cleanup cookies = [] url.path = '/' if url.path.empty? @jar.each_key do |domain| if url.host =~ /#{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