Template for session expired

102 views
Skip to first unread message

ProfessionalIT

unread,
Sep 15, 2012, 9:43:21 AM9/15/12
to we...@googlegroups.com
is possible personalize the template/output when the session is expired ?

I have this code in my code.py:

web.config.session_parameters['timeout'] = 360 
web.config.session_parameters['ignore_expiry'] = False
web.config.session_parameters['expired_message'] = 'Session Expired !, refresh the page !'

when session expires the output is a blank page. How to personalize this ?

thanks
Leandro.

Zhang Huangbin

unread,
Sep 15, 2012, 11:27:49 AM9/15/12
to we...@googlegroups.com
Here's my code:

# ----
class SessionExpired(web.HTTPError):
    def __init__(self, message):
        message = web.seeother('/login?msg=SESSION_EXPIRED')
        web.HTTPError.__init__(self, '303 See Other', {}, data=message)                                                       

web.session.SessionExpired = SessionExpired                                                                                   
# ----
Reply all
Reply to author
Forward
0 new messages