New issue
Advanced search Search tips

Issue 705624 link

Starred by 3 users

Issue metadata

Status: Archived
Owner: ----
Closed: Mar 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug



Sign in to add a comment

Persistent cookies disappear when Chrome is closed unproperly

Reported by prmr...@gmail.com, Mar 27 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36

Steps to reproduce the problem:
1. The webserver sets a cookie in the HTTP Response which expires in 30 days;
2. Chrome receives the response and sets the cookie;
3. Chrome is closed unproperly (killed process or reboot of PC) a few seconds after step 2;
4. Chrome is reopened and the same page where the cookie was set is opened;

What is the expected behavior?
The cookie should still be present in subsequent HTTP Requests to the web site.

What went wrong?
The cookie disappeared from the HTTP Requests.

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 57.0.2987.110  Channel: stable
OS Version: 6.3
Flash Version: 

I've checked the 'Cookies' file stored in 'C:\Users\my_user\AppData\Local\Google\Chrome\User Data\Default' and it seems it is only updated approximately once every minute or so. It looks like new cookies are all stored in RAM for a while and then saved as a batch to the hard drive.
I've also tried to set the cookie directly with javascript (using js-cookie library) but the outcome was the same:

Cookies.set('cookie_name', 'cookie_value', { expires: 30 });

How can I store cookies instantly and persistently?
 
Components: Internals>Network>Cookies
Labels: -Pri-2 Pri-3
Looks like the sqlite persistent cookie store persists the cookies to disk every 30s:
https://cs.chromium.org/chromium/src/net/extras/sqlite/sqlite_persistent_cookie_store.cc?type=cs&l=1072
It's been this way since the first commit in 2008.
I assume this is a trade-off between disk usage and survival rate.

Comment 2 by prmr...@gmail.com, Mar 28 2017

And isn't there a way to force it to do this immediately, without waiting 30s?

Comment 3 by mmenke@chromium.org, Mar 28 2017

No.  Otherwise an attacker could basically hose someone's HDD with document.cookie writes.  I think this is probably just a WontFix, given that this is the first bug I'm aware of about the behavior.
Labels: TE-NeedsTriageHelp
Project Member

Comment 5 by sheriffbot@chromium.org, Mar 30 2018

Status: Archived (was: Unconfirmed)
Issue has not been modified or commented on in the last 365 days, please re-open or file a new bug if this is still an issue.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment