cancel
Showing results for 
Search instead for 
Did you mean: 

Change Cookie To Expire From 1 Day To 8 Hours?

orthohin
Grand Master

Hi,

 

 

How can I change the following code to have the cookie expire in 8 hours instead of 1 day as it does now?

// key and at least value given, set cookie...
        if (arguments.length > 1 && (!/Object/.test(Object.prototype.toString.call(value)) || value == null)) {
            options = $.extend({}, $.cookie.defaults, options);

            if (value == null) {
                options.expires = -1;
            }

            if (typeof options.expires === 'number') {
                var days = options.expires, t = options.expires = new Date();
                t.setDate(t.getDate() + days);
            }

            value = String(value);

 Thanks

1 REPLY 1

Sogo7
Grand Master

Is this a homework question ?

 

Because somebody asked this word for word way back in 2008

http://www.webhostingtalk.com/showthread.php?t=1235394

Lovelogic.net UK Jobs Scanner