我正在尝试设置cookie及其路径,但无法正确设置路径
I am trying to set a cookie and its path but not able to set the path correctly
当我使用类似var
值=取决于用户选择的某个数组。
document.cookie = "filters="+values;
如果路径是/abc def/
p>试试这个:document.cookie="name=value;path=/";
您可以使用
values=JSON.stringfy(values);document.cookie="filters="+值;
这将帮助您获得更多
$.cookie("test", 1, {
expires : 10, //expires in 10 days
path : '/', //The value of the path attribute of the cookie
//(default: path of page that created the cookie).
domain : 'google.com', //The value of the domain attribute of the cookie
//(default: domain of page that created the cookie).
secure : true //If set to true the secure attribute of the cookie
//will be set and the cookie transmission will
//require a secure protocol (defaults to false).
});
相关文章:
- Javascript:使用绝对路径设置img src
- 如何设置SVG路径的样式以拍摄图像
- Soundmanager 2,无论我尝试什么,我都无法设置SWF路径
- 如何根据两个不同的输入动态设置链接的路径
- Angular sqlLite set css url()无法设置相对路径
- 在使用 Django 静态文件时动态设置映像时,只有绝对路径才能与 jquery 一起使用
- 在相对于用户当前 URL 路径的不同路径中设置 Cookie
- RequireJS设置父级的路径
- ckeditor jquery适配器设置模板路径
- 如何以类似于vivus.js的样式设置SVG填充和路径的动画
- VueJS$设置有可变密钥路径
- 在jQuery File upload插件中设置变量上传路径
- 如何设置与CKEditor一起使用的图像路径
- 使用 javascript 设置的 cookie,无法使用 PHP 识别(相同的域和路径)
- 咕噜咕噜浏览器化 - 设置包含,回退路径
- 使用画布沿弯曲运动路径设置动画
- Chrome没有将cookie路径设置为root
- 在Javascript中使用相对路径设置谷歌地图图标
- 如何在javascript中为自定义地图上的路线路径设置动画
- 如何为路径设置属性