cookies shorter than a session?



I'm trying to set a cookie to expire 10 seconds after it is created.
However, it seems to last until I close all browser windows.

var objDate = new Date();
objDate.setSeconds( objDate.getSeconds() + 10 );
document.cookie = "hasSeenPopup=TRUE;";
document.cookie += "expires=" + objDate.toGMTString();

I then set the cookie to expire in 1000 seconds, to test that it could
indeed last longer than a session. However, when I close all browser
windows, the cookie is gone by the time I reopen the browser, no matter
how quickly I do this.

I am doing something incorrectly?

.



Relevant Pages

  • 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)
  • Re: Cookies question
    ... if you can close down all browser windows and with a new one bypass the login ... maybe somehting with you session cookie?? ... > and then click this link and still bypass the log in page. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • (auto) session expire
    ... minutes of inactivity. ... When user is inactive for 10 minutes the session will expire. ... The browser will delete the cookie because it was told by the server. ...
    (php.general)
  • Re: deleting cookies and local browser time versus server time
    ... based on what *it* thinks the time is, not what the server thinks the ... looks to be 3 or 4 hours in the past to my browser. ... give a cookie to expire at 4PM today, which is the time in Seattle, ...
    (comp.lang.php)
  • Re: Viewing contents of a cookie
    ... Then I redirect the browser to cookiecheck.php, ... But that page is not displaying the username. ... Is this a question of setting the path where the cookie is supposed to ... you'll most likely set this with the timefunction plus the number of seconds before you want it to expire. ...
    (comp.lang.php)