Setting a cookie to expire on browser close

660 views
Skip to first unread message

jechu

unread,
Aug 17, 2010, 2:30:42 AM8/17/10
to Tornado Web Server
How would I go about making a cookie that expires once the browser is
closed? I've taken a quick look at the code in the
tornado.web.RequestHandler class and noticed that there are parameters
that allow you to specify expiration times, but I don't see anything
that allows you to specify that the cookie expires whenever the
browser closes.

Thanks!

Brian Browning

unread,
Aug 17, 2010, 2:47:56 AM8/17/10
to python-...@googlegroups.com
The default setting for tornado cookies is to expire at end of session.
So you shouldn't have to do anything special, 
just set the cookie, close your browser , and the cookie will be gone.

Li Hui

unread,
Aug 17, 2010, 3:15:43 AM8/17/10
to python-...@googlegroups.com
I found the default expire time of set_secure_cookie is one month.

-- 
Li Hui
Reply all
Reply to author
Forward
0 new messages