mirror of
https://github.com/samsonjs/http-cookie.git
synced 2026-03-25 08:55:53 +00:00
Do not store a cookie if it is already expired at the time of adding.
This commit is contained in:
parent
1fcf008cf0
commit
f60e678cb8
1 changed files with 7 additions and 1 deletions
|
|
@ -26,7 +26,13 @@ class HTTP::CookieJar
|
|||
end
|
||||
normal_domain = cookie.domain_name.hostname
|
||||
|
||||
((@jar[normal_domain] ||= {})[cookie.path] ||= {})[cookie.name] = cookie
|
||||
path_cookies = ((@jar[normal_domain] ||= {})[cookie.path] ||= {})
|
||||
|
||||
if cookie.expired?
|
||||
path_cookies.delete(cookie.name)
|
||||
else
|
||||
path_cookies[cookie.name] = cookie
|
||||
end
|
||||
|
||||
self
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue