HTTP::CookieJar#cookies: accessed_at is updated in the underlying store.

This commit is contained in:
Akinori MUSHA 2013-04-11 21:12:53 +09:00
parent 9c7d563da5
commit 57218cb858

View file

@ -70,12 +70,11 @@ class HTTP::CookieJar
end
alias << add
# Gets an array of cookies that should be sent for the URL/URI.
# Gets an array of cookies that should be sent for the URL/URI,
# updating the access time of each cookie.
def cookies(url)
now = Time.now
each(url).select { |cookie|
!cookie.expired? && (cookie.accessed_at = now)
}.sort
each(url).reject(&:expired?).sort
end
# Tests if the jar is empty. If `url` is given, tests if there is