jQuery cookie control
How to create cookie, which will work on all pages over choosen site?
Using cookie plugin.
Code must add cookie "movie_check" with value "no", which can be used over all pages on site "www.site.c开发者_开发技巧om" (were script is implemented). Expires after 365 days.
Tryed this (doesnt work):
$.cookie("movie_check", "no", {expires: 365, domain: 'www.site.com'});
Thanks.
Try:
var date = new Date();
date.setTime(date.getTime() + (3 * 24 * 60 * 60 * 1000));
$.cookie('movie_check', 'no', { path: '/', expires: date });
Your code sets an expiration date in the past.
精彩评论