{path:"/",expires:7 }这一段是什么意思 ?
$.cookie("email".$("#email").val(),{path:"/",expires:7 })的 {path:"/",expires:7 }这一段是什么意思 ?
$.cookie("email".$("#email").val(),{path:"/",expires:7 })的 {path:"/",expires:7 }这一段是什么意思 ?
2017-07-29
创建会话cookie:
$.cookie('name', 'value');
创建到期的cookie,然后7天:
$.cookie('name', 'value', { expires: 7 });
创建有效到期cookie,整个网站:
$.cookie('name', 'value', { expires: 7, path: '/' });
读取cookie:
$.cookie('name'); // => "value"$.cookie('nothing'); // => undefined
读取所有可用的饼干:
$.cookie(); // => { "name": "value" }
删除Cookie:
// Returns true when cookie was successfully deleted, otherwise false$.removeCookie('name'); // => true$.removeCookie('nothing'); // => false// Need to use the same attributes (path, domain) as what the cookie was written with$.cookie('name', 'value', { path: '/' });// This won't work!$.removeCookie('name'); // => false// This will work!$.removeCookie('name', { path: '/' }); // => true
注意:在删除cookie,你必须通过相同的路径,域和安全选项,是用来设置cookie,除非你依靠默认的选项是。
举报