开发者

jquery session cookie life

开发者 https://www.devze.com 2023-03-11 06:46 出处:网络
I am using the jquery cookie plugin (jquery.cookie.js) to set a session cookie, something like below $.cookie(\'cookieName\', \'value\');

I am using the jquery cookie plugin (jquery.cookie.js) to set a session cookie, something like below

$.cookie('cookieName', 'value');

I have noticed that when there is only one browser window I am working with, then the cookie expires when that window is closed.

When there are multiple browser windows open at the same time (need not be my application running on them), closing one browser window, doesn't expire the cookie.

Is this behaviour normal? Ideally, I would like the cookie to expire when the browser running my application is closed开发者_开发百科. Is this possible?


you will be use this code for 7 days

$.cookie("example", "foo", { expires: 7 });
0

精彩评论

暂无评论...
验证码 换一张
取 消