Re: Cookies in non-server pages?
- From: Dr John Stockton <jrs@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 27 Jan 2006 17:45:03 +0000
JRS: In article <11408159.n3ykvaZaOn@xxxxxxxxxxxxxx>, dated Thu, 26 Jan
2006 20:54:07 remote, seen in news:comp.lang.javascript, Thomas
'PointedEars' Lahn <PointedEars@xxxxxx> posted :
>Dr John Stockton wrote:
>
>> [...] Thomas 'PointedEars' Lahn [...] posted :
>>
>>> document.cookie = "foo=" + d.toGMTString()
> ^
>>> + "; expires="
>>> + new Date(d.getTime() + 24*3600000).toGMTString()
>>> + "; path=/home/scripts/test"; // modify to fit your needs
>>
>> If users of that announce a 1-day lifetime, they should be prepared for
>> complaints at the end of October.
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> Using d.setDate(d.getDate()+1)) would not be significantly slower.
>
>Nice to know. Why do you assume it was my intention to let the cookie
>expire 1 day later?
I assumed nothing about your intention; I was referring to what the
unwitting consumer of your flawed advice might think your code eas good
for.
>> Why do you choose to recommend use of a property which has been
>> deprecated since 1998 or earlier (or has it been de-deprecated in
>> acknowledgement of the fact that in javascript (by specification) and in
>> most computers the time behaves more like GMT than UTC)?
>
>Because this is but an example for a cookie that will not expire by the end
>of the session?
So why use a deprecated method when a non-deprecated one will do the
job? It's not setting a good example.
>> You should read ECMA-262, backwards.
>
>Everybody should; starting with you, as you seem to have too much free time
>on your hands, making wild assumptions about the most unimportant details
>just to comment anything.
Now you're being puerile - or is it early Alzheimer's, or just your true
nature showing?
--
© John Stockton, Surrey, UK. ???@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Check boilerplate spelling -- error is a public sign of incompetence.
Never fully trust an article from a poster who gives no full real name.
.
- References:
- Cookies in non-server pages?
- From: Stephan Schulz
- Re: Cookies in non-server pages?
- From: Thomas 'PointedEars' Lahn
- Re: Cookies in non-server pages?
- From: Stephan Schulz
- Re: Cookies in non-server pages?
- From: Thomas 'PointedEars' Lahn
- Re: Cookies in non-server pages?
- From: Dr John Stockton
- Re: Cookies in non-server pages?
- From: Thomas 'PointedEars' Lahn
- Cookies in non-server pages?
- Prev by Date: Re: ignore document.onkeyup events for set a period?
- Next by Date: Re: ignore document.onkeyup events for set a period?
- Previous by thread: Re: Cookies in non-server pages?
- Next by thread: JS XML
- Index(es):
Relevant Pages
|