Thanks Klaus,
I'm using http/1.1, It's my desktop computer, XP system with IIS 5.1, I
modify the host file, add a test domain name, for example: 127.0.0.1
demo.com,
It seems default cookie plug in execute not correctly.

Best wishes,
Toby
2006-11-5

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Klaus Hartl
Sent: 2006年11月5日 22:53
To: jQuery Discussion.
Subject: Re: [jQuery] Also new bug in cookie plugin

Microtoby schrieb:
> Hi, all,
> 
> It seems no more people use the cookie plug in, I'm find new a bug again.
> When I set the expires parameter to 7, cookie always expires when browser
> closing.
> I'm traced the problem,
> First:
>
---------------------------------------------------------------------------
> Line 62: maxAge = options.expires * 24 * 60 * 60; // seconds
> This line should write as: maxAge = options.expires * 1000 * 24 * 60 * 60;
> //days
>
---------------------------------------------------------------------------
> Second:
>
---------------------------------------------------------------------------
> Line 73: expires = '; max-age=' + maxAge;
> This line sould write as:
> var mydate = new Date();
> mydate.setTime(mydate.getTime() + maxAge);
> expires = '; expires=' + mydate.toGMTString();
>
---------------------------------------------------------------------------
> I don't know if it corrent for me...
> 
> Best wishes,
> Toby

Hi Toby,

beginning with HTTP 1.1 cookies use max-age which defines the lifetime 
of the cookie, in seconds. The expires attribute is deprecated.

The value for the expires option should be given in days, as documented, 
so the result of options.expires * 24 * 60 * 60 is correctly seconds.

I don't see a bug here. What exactly went wrong? Maybe you came across 
an HTTP 1.0 server?

Should I add an option for that?


-- Klaus

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to