Cookies persist for some ajax requests even after deleting
Reported by
dmatafo...@gmail.com,
May 14 2018
|
||||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36 Steps to reproduce the problem: 1. I set session cookie SID 2. I remove session cookie in Application tab 3. One of the ajax requests still sends DELETED cookie to server What is the expected behavior? Cookie should not persist after removing What went wrong? https://www.screencast.com/t/W6vonjkeeAdt Did this work before? Yes Chrome version: 66.0.3359.139 Channel: n/a OS Version: 10.0 Flash Version: If you go to Applocation/Application/Clear storage -> then cookie is finally deleted and doent restore anymore
,
May 14 2018
Note that when you typed document.cookie, the SID cookie was not displayed - indicating, as elawrence says, that it may be an HttpOnly Cookie. Generally, if document.cookie doesn't display a cookie, it can't delete it, either.
,
May 14 2018
Its not the case, we dont use httpOnly cookies and as shown in screencast - if I open ajax request in separate tab, the SID cookie is available and visible. And it also visible and available before deleting. What else can I check? It is quite easy to reproduce - you ll need demo account at tradernet.ru. Login then click some tabs, load some pages in menu and exit. Then check networks and you will see that browser sends cookie with ajax request to 'ajax-get-client-status' even if it deleted.
,
May 14 2018
Looks like the SID cookie has a path set (Which is presumably /authentication), and you're clearing cookies on a request with path of /user/...
,
May 14 2018
,
May 14 2018
SID cookie on login is set to / path https://www.screencast.com/t/YhQp3lTbVGYr And it stays and show before deleted on that path https://www.screencast.com/t/O2RywS8iy
,
May 14 2018
Look at your video, at 1:28. The SID line has "/..." under path.
,
May 14 2018
,
May 15 2018
So trouble is that cookie has the path? And in that case it should be invisible in Application tab and absent in document.cookie? Is that an expected behavior? Because I dont understand how's that should work - come cookies that we set with path are visible in application tab of main window and could be deleted there. What is different about this one?
,
May 15 2018
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
May 15 2018
Another video that shows that there is a path in the cookie. But cookie itself is shown only on separate tab, not on the main window. https://www.screencast.com/t/U9sT3pW6e
,
May 15 2018
I cant easily reproduce this bug today - most of times cookie deleted with logout as expected and how it worked previous 5 years. But sometimes cookie persists somewhere inside the browser. Lost on ideas on how to debug it, need help.
,
May 15 2018
Sorry, I was wrong, or at least not really correct. document.cookie='' is not supposed to delete all cookies - it's basically equivalent to the http line "Set-Cookie:" - i.e., it sets a nameless cookie. It does not delete all cookies. To delete a cookie, you'd need to do document.cookie='SID=whatever;expires=Thu, 01-Jan-70 00:00:01 GMT;path=/<insert path here>' Experimentally, IE exhibits the same behavior. You may be seeing a behavior change in the cookie store somewhere, but document.cookie='' not deleting cookies isn't that change. Mozilla's handy docs: https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie
,
May 15 2018
> "Set-Cookie:" - i.e., it sets a nameless cookie. It does not delete all cookies. Ok, got you. But setting document.cookie='' was just an example - I can delete from Application tab. Usually and regulary it is deleted from server side on logout, when header is sent. Example of server response to delete SID cookie: Set-Cookie: SID=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; domain=.tradernet.ru
,
May 15 2018
mmenke@chromium.org - can you try to reproduce issue on website? Or tell me what you want to try - Ill make a screencast.
,
May 15 2018
To delete a cookie via Set-Cookie, it must have exactly the same name and path as it was set with. To attempt to reproduce on the site in question, I assume we would need a test account.
,
May 16 2018
As per comment#16 adding Needs-Feedback label. @Reporter: Please provide sample credentials if possible. Thanks!
,
May 21 2018
,
Jun 4 2018
ping reporter, it would help to provide a test site that reproduces this issue, or a net-log dump exhibiting the bug: https://dev.chromium.org/for-testers/providing-network-details
,
Jun 4 2018
I finally found what was the problem and now I am not sure if its a bug or feature. Here is how to reproduce. 1. Go to https://tradernet.com/authentication/login 2. Set cooike with path by js in console, typing $.cookie('SID', 'test') 3. Now go to https://tradernet.com/instruments (different path) 4. Open Console -> Application -> Cookies -> https://tradernet.com You will see that there is no cookie, named SID, exists. You can clear all cookies anyway you like. In browser or by js. No go again to https://tradernet.com/authentication/login, open console->application->cookie and you will see cookie SID=test. Looks like a bug for me, because no matter what path is set cookie should be shown in Application->Cookies and user should be able to delete it from there.
,
Jun 4 2018
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jun 4 2018
Yep I can reproduce the issue in c#20. Going to re-add the devtools label since it looks like the problem is isolated to that UI surface. After setting SID=test, I can always see that cookie by navigating to the Origin Info Bubble (click the "Secure" button next to the URL) and clicking "Cookies".
,
Jun 4 2018
> After setting SID=test, I can always see that cookie by navigating to the Origin Info Bubble (click the "Secure" button next to the URL) and clicking "Cookies". Yes, but now imagine that you are developer and you are on /instruments page. You have about 100 ajax requests sent to the server, you dont see any cookies in Application tab. How do you know that one of the requests to particular path was sent WITH the cookie?
,
Jun 4 2018
Hey dmatafonov, You can see exactly which cookies are being sent in a request by using chrome://net-internals. I verified in this case that https://tradernet.com/instruments does _not_ send the SID=test cookie, whereas the request to https://tradernet.com/authentication/login did use the cookie. Devtools is probably just using cookies that were used by the actual page navigation.
,
Jun 5 2018
Browser and network do work as expected. Devtools doesnt. Application->cookies->domain SHOLD show all cookies for selected domain, not just cookies with / path AND selected path. Otherwise there is no way to see all cookies with all paths for selected domain in devtools, but thats what devtools is created for.
,
Jun 6 2018
,
Jun 11 2018
einbinder@ or caseq@, could you please take a look
,
Sep 18
,
Jan 2
Issue 918413 has been merged into this issue. |
||||||||||||
►
Sign in to add a comment |
||||||||||||
Comment 1 by elawrence@chromium.org
, May 14 2018Labels: -Type-Bug-Security -Restrict-View-SecurityTeam Type-Bug