I did this:
$.cookie(\"ultOS\", (i), {expires:1});
But it will only expire next day.
How can I expire a cookie at midnight?
According to the latest version of ths cookie plugin (assuming this is the one you're using: http://plugins.jquery.com/project/Cookie), you can pass a normal Date object in.
I haven't tried it, but the source of the plugin is fairly straightforward....
if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
var date;
if (typeof options.expires == 'number') {
date = new Date();
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
} else {
date = options.expires;
}
expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
}
If you pass in a number, it assumes that's number of days. If you pass in a Date, it takes that.