From 51da5e4c5056193f77ab2abbce5bd655f4392988 Mon Sep 17 00:00:00 2001 From: Akinori MUSHA Date: Tue, 26 Mar 2013 01:43:06 +0900 Subject: [PATCH] Do not touch and yield a cookie that should not be sent. --- lib/http/cookie_jar/hash_store.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/http/cookie_jar/hash_store.rb b/lib/http/cookie_jar/hash_store.rb index 55e581b..fa3bf36 100644 --- a/lib/http/cookie_jar/hash_store.rb +++ b/lib/http/cookie_jar/hash_store.rb @@ -63,8 +63,10 @@ class HTTP::CookieJar if cookie.expired? true else - cookie.accessed_at = Time.now - yield cookie + if cookie.valid_for_uri?(uri) + cookie.accessed_at = Time.now + yield cookie + end false end }