Setting a timeout for a cookie

S

sophie_newbie

Hi,

I'm wondering how do you set a 'timeout' or expiry date/time for a
cookie set using a python cgi script. I can set a cookie ok but I
dunno how to set the expiry time so it always expires at the end of
the session.

Thanks!
 
P

Peter Bengtsson

Hi,

I'm wondering how do you set a 'timeout' or expiry date/time for a
cookie set using a python cgi script. I can set a cookie ok but I
dunno how to set the expiry time so it always expires at the end of
the session.

Easy, you don't. It's only if you set a timeout (aka. expires
parameter) that it will last longer than the session.
Just don't set it and it'll last till the browser is shut down.
 
J

John J. Lee

Peter Bengtsson said:
Easy, you don't. It's only if you set a timeout (aka. expires
parameter) that it will last longer than the session.
Just don't set it and it'll last till the browser is shut down.

And don't set a max-age parameter either (max-age and expires do
essentially the same thing).


John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top