Nomadicus
12-05-2002, 12:06 AM
I'm trying to set a cookie to expire one hour in the future (for testing purposes).
Can anyone give me some clear code, in one or two lines, how to do this?
I just want to know, in plain English, how to get the current time, and then add 60 minutes to it (and then do the funky GMT time conversion that JS needs).
The on-line manuals don't tell you anything this basic. They all want to tell you how to set cookies for the future, by converting furlongs per fortnight, adding in +4.7 parsecs Star Trek time, and then putting this thru their favorite fudge-altor function to approximate time on Alpha Centauri.
I just want to know how to set a freaking cookie for one hour in the future. In PHP this is a snap, just use time() + 3600;
But I must do this in JS.
Thanks in advance.
Can anyone give me some clear code, in one or two lines, how to do this?
I just want to know, in plain English, how to get the current time, and then add 60 minutes to it (and then do the funky GMT time conversion that JS needs).
The on-line manuals don't tell you anything this basic. They all want to tell you how to set cookies for the future, by converting furlongs per fortnight, adding in +4.7 parsecs Star Trek time, and then putting this thru their favorite fudge-altor function to approximate time on Alpha Centauri.
I just want to know how to set a freaking cookie for one hour in the future. In PHP this is a snap, just use time() + 3600;
But I must do this in JS.
Thanks in advance.