How can I set a unique cookie for each website domain
Having a problem with conflicting cookies when I switch domains. How can I set a unique cookie for each website domain with:
var $tabs = $("#tabs").tabs({
cookie: {
name: 'tab_cookie',
expires: 7,
},
fx: {
opacity: 'toggle',
duration: 'fast'
}
});
If possible I would like this to work in the local development envir开发者_Go百科onment using localhost. E.g: http://localhost/cms1
You can set the domain
and path
in the cookie
option, e.g.
var $tabs = $("#tabs").tabs({
cookie: {
domain: 'localhost',
path: '/',
name: 'tab_cookie',
expires: 7,
},
...
});
Take a look at the documentation of the cookie plugin for more options you can set.
精彩评论