Open rikhtehgaran opened 8 months ago
Hi I have been using the beaker in Bottle framework but I don't know how to update the session cookie expiration time in a beaker it's my code. I need to update the expiration time in the test method when called
import bottle from beaker.middleware import SessionMiddleware session_opts = { 'session.type': 'file', 'session.cookie_expires': 300, 'session.data_dir': './data', 'session.auto': True, } app = bottle.Bottle() subapp = SessionMiddleware(app, session_opts,environ_key="myapp") @app.route('/test') def test(): s = bottle.request.environ.get('myapp') subapp.options={'session.cookie_expires': 300} s['test'] = s.get('test',0) + 1 s.save() return 'Test counter: %d' % s['test'] bottle.run(app=subapp, port=8000)
Hi I have been using the beaker in Bottle framework but I don't know how to update the session cookie expiration time in a beaker it's my code. I need to update the expiration time in the test method when called