1from datetime import timedelta
2 app = Flask(__name__)
3 app.config['SECRET_KEY'] = 'xxxxxxxxx'
4 app.config['PERMANENT_SESSION_LIFETIME'] = timedelta(minutes=5)
5The session will created for each client, seperated from other clients. So, I think the best place to set session.permanent is when you login():
6
7@app.route('/login', methods=['GET', 'POST'])
8def login():
9 #After Verify the validity of username and password
10 session.permanent = True