When I use like
var
values = some array which depends on the user selections.
document.cookie = "filters="+values;
How can I set the path for this cookie if the path is /abc-def/
When I use like
var
values = some array which depends on the user selections.
document.cookie = "filters="+values;
How can I set the path for this cookie if the path is /abc-def/
Try this:
document.cookie="name=value;path=/";
You can use
values = JSON.stringify(values); document.cookie = "filters="+values;
This will help you more
$.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).
});