cookie deletion does not work with more than one cookie, will fix that...

-- Klaus



Klaus Hartl schrieb:
> 
> Microtoby schrieb:
>> I'm find a bug in jQuery's Cookie plugIn.
>>
>> When you write more than 2 cookies, from the second, you could not read 
>> it value correctly.
>>
>> It's because read document.cookie is "cookie1=val1; cookie2=val2", 
>> behind ";", there is a blank. So the source code line 72 cause error "if 
>> ( cookie.substring(0, name.length + 1) == (name + '='))".
>>
>> Fix it, just modify line 68:
>>
>> Old style: var cookies = document.cookie.split(';');
>>
>> New style: var cookies = document.cookie.replace("; ", ";").split(';');
>>
>>  Regards,
>>
>> Microtoby
> 
> Thanks for the catch, I fixed that in SVN. I modified line 70:
> 
> var cookie = $.trim(cookies[i]);
> 
> 
> -- 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