Closed Bug 1017319 Opened 11 years ago Closed 8 years ago

Setting an existing cookie to expire in the past does not update sqlite storage

Categories

(Core :: Networking: Cookies, defect)

29 Branch
x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jonoden, Assigned: amchung)

Details

(Whiteboard: [necko-active])

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36 Steps to reproduce: Tested extensively in Firefox 29.0.1 on Mac OSX 10.9.3 Set two cookies: name:"TEST-1",path:"/",domain:"www.example.com",expires:1 year from date name:"TEST-1",path:"/",domain:".example.com",expires:1 year from date See that they both exist and both are sent in requests and both can be seen in the sqlite cookies db. Attempt to expire one of them using either: Set-Cookie: TEST-1=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=www.example.com Response header for a page on "www.example.com" OR Using JavaScript on a page on "www.example.com" Actual results: When using Response header, the cookie is never deleted from the sqlite database, both cookies still exist. Both cookies are sent to next request to a page on www.example.com Using JS, we can see the cookies are actually removed in the page instance, but they are never removed from sqlite storage. They are both sent in the next request to www.example.com Expected results: The cookie with domain:www.example.com should have been updated or removed from the cookie storage since it had expired leaving only the cookie under domain .example.com
Whiteboard: [necko-backlog]
Assignee: nobody → amchung
Whiteboard: [necko-backlog] → [necko-active]
I found if I comment line 2374 on netwerk/cookie/nsCookieService.cpp, the delete function is normal. And I used aIter.entry->GetCookies().Length() to confirm the quantity of cookies in sqlite db, I determined the be removed item would be delete.
(In reply to Amy Chung [:Amy] from comment #1) > I found if I comment line 2374 on netwerk/cookie/nsCookieService.cpp, > the delete function is normal. > And I used aIter.entry->GetCookies().Length() to confirm the quantity of > cookies in sqlite db, > I determined the be removed item would be delete. Sorry, comment 2375 not 2374.
Hi Jon, I have reproduce this bug by your reproduce steps, but I can't reproduce. The following is my reproduce steps: 1. Enter www.example.com 2. Used the cookie command "cookie set test-1 test" on Developer Toolbar at Firefox 29.0.1. 3. Confirmed the cookie items that existed on Storage and Sqlite browser. 4. Used the cookie command "cookie set test-1 test --expires "21 Nov 2015 12:00:00"" 5. Found the cookie item would be delete after setting the expiration date. (This cookie item didn't exist on Storage and Sqlite browser). But I found the other bug on setting cookie, and I already reported the bug https://bugzilla.mozilla.org/show_bug.cgi?id=1273835. Would you tell us how do you confirm the cookie didn't delete on sqlite db? Thanks!
Flags: needinfo?(jonoden)
Hi Jon, I closed this bug because I wouldn't reproduce it. If you would offer us some steps for reproducing bug, please feel free to reopen this bug.
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME

This is a massive necro, for some reason I wasn't getting notifications for this, sorry. Obviously not worth looking into on my side at this point just wanted to apologize for the radio silence.

Flags: needinfo?(jonoden)
You need to log in before you can comment on or make changes to this bug.