Re: Cookies in non-server pages?



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.
.



Relevant Pages

  • Re: Cookies in non-server pages?
    ... > complaints at the end of October. ... > 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 ...
    (comp.lang.javascript)
  • Re: Setting Cookie.Expires
    ... As for the Cookie expire time, it does have been set on the cookie (you add ... Microsoft MSDN Online Support Lead ... from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Question about cookies.
    ... Hey Roland, Have a look at this article, ... destroyed when the user closes his/her browser. ... destroy the cookie. ... > Sessions do not expire when the client closes the browser. ...
    (microsoft.public.scripting.vbscript)
  • "Page has expired" - again
    ... The web site has anonymous access and the only cookie ... >This sounds like a scripting issue on the site. ... they are set to expire. ... >>major like converting POST to GET etc. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: PageLoad when BACK is clicked
    ... not expire. ... >> And then also create a cookie with a timestamp (and ... Otherwise reload the page. ... >Outgoing mail is certified Virus Free. ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)