search

Home  >  Q&A  >  body text

Chrome doesn't delete session cookies

<p>I'm trying to set a session cookie in javascript, like this: </p> <pre class="brush:php;toolbar:false;">document.cookie = 'name=alex; path=/'</pre> <p>But even if I quit the browser and start it again, Chrome won't delete it. </p> <p> I checked in Firefox and Opera and both work as expected - they delete the session cookie when the browser exits. </p> <p>Did Chrome just ignore the expiration rule? </p> <p>I checked in multiple operating systems and found that session cookies are deleted in Chrome on Windows XP and Ubuntu, but not on Mac OSX Lion. </p>
P粉546179835P粉546179835509 days ago646

reply all(2)I'll reply

  • P粉654894952

    P粉6548949522023-08-17 13:24:07

    I just ran into the same problem, a cookie was set to expire "at the end of the browsing session".

    Unfortunately, it didn't expire, so I made some adjustments in my browser's settings.

    It turns out that the ability to remember open tabs when the browser is closed is the source of the problem. (This feature is called "On startup" - "Continue where you were" on current versions of Chrome).

    This problem also occurs in Opera and Firefox.

    reply
    0
  • P粉511985082
  • Cancelreply