mirror of
https://github.com/samsonjs/http-cookie.git
synced 2026-03-25 08:55:53 +00:00
HTTP::CookieJar#cookies: accessed_at is updated in the underlying store.
This commit is contained in:
parent
9c7d563da5
commit
57218cb858
1 changed files with 3 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue