cookies shorter than a session?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

cookies shorter than a session?

From: 2obvious <EverettLindsay@gmail.com>
Date: Thu Aug 04 2005 - 21:08:55 CEST

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?
Received on Tue Oct 18 03:05:23 2005