I'm writing an app using bottle.py and beaker.middleware.SessionMiddleware
:
How can I modify the session.timeout
and session.cookie_expires
values so I can implement a login system that logs the user in for 30 days?
I already implemented the standard login system so everything works until the browser closes, but I'd like to modify those values if the user checks the Remember me checkbox.
I thought of two variants if the user checks the Remember me checkbox:
Set
session.cookie_expires
andsession.timeout
to 30 days, but it seems that I can't modify these values at run-time because the cookie I recieve expires at the end of the browser session, ignoring my runtime modifications.Set
session.timeout
to 30 days and overwrite the cookie namedbeaker.session.id
writing the same session id but different expiry date. But the run-time problem from point 1. remains and it seems that I can't access the session's id that I just created with beaker, so I don't know what to store in the cookie.
How can I implement this?