beaker
beaker copied to clipboard
Support modifying session's cookie_expires attribute on runtime.
With this feature, we can easy expire session due to inactivity of a user.
For example, if we want to expire the cookie when the browser has not requested any page in 5 minutes, we can do this:
# Flask
@app.after_request
def per_request_callbacks(response):
session = request.environ['beaker.session']
session.cookie_expires = 300
return response