开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜