session.permanent = True
app.permanent_session_lifetime =
не имеет смысла.from datetime import timedelta
from flask import session, app
@app.before_request
def make_session_permanent():
session.permanent = True
app.permanent_session_lifetime = timedelta(minutes=5)