Js-cookie: Sessions Cookie is not expired after browser close

Created on 29 Nov 2018  Â·  9Comments  Â·  Source: js-cookie/js-cookie

import * as Cookie from 'js-cookie';
        Cookie.set('session', 'test');

// cookies created
// close browser
// open browser, cookie exists

According to docs

expires
Define when the cookie will be removed. Value can be a Number which will be interpreted as days from time of creation or a Date instance. If omitted, the cookie becomes a session cookie.

Cookie set once when form submitted, so after browser reopen it will not be set. Is this expected behaviour?

Most helpful comment

Done: https://github.com/js-cookie/js-cookie/wiki/Frequently-Asked-Questions#why-the-browser-does-not-remove-the-cookies-after-i-close-it

All 9 comments

This is not expected behavior. Could you let us know which browser you‘re using, whether you observe the same behavior in a different browser, and which extensions you‘re using?

I encounter the issue too, using chrome 70.

I found this: https://stackoverflow.com/questions/10617954/chrome-doesnt-delete-session-cookies

Do you have “Continue where I left off” activated?

I found this: https://stackoverflow.com/questions/10617954/chrome-doesnt-delete-session-cookies

Do you have “Continue where I left off” activated?

So that explains it. Thx!

Yes, “Continue where I left off” is enabled in my browser Google Chrome 70.

So Chrome still keeps the cookie for the “Continue where I left off” functionality? I have probably seen this in the past but we never documented it. Is it worth documenting this problem in the README @BonBonSlick @jakiefeng @carhartl?

I'll close for now but if it's worth documenting something we can reopen 👍

I think yes, it should be documented, or mentioned to avoid future questions like this.

Done: https://github.com/js-cookie/js-cookie/wiki/Frequently-Asked-Questions#why-the-browser-does-not-remove-the-cookies-after-i-close-it

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Daijobou picture Daijobou  Â·  6Comments

tom-korec picture tom-korec  Â·  3Comments

luis-pato picture luis-pato  Â·  6Comments

columbian-chris picture columbian-chris  Â·  4Comments

sudhir600 picture sudhir600  Â·  9Comments