try make the session permanent
This commit is contained in:
parent
554359d7f5
commit
873525d9e0
9
app.py
9
app.py
@ -17,6 +17,15 @@ app.config.from_object(
|
|||||||
)
|
)
|
||||||
cache = Cache(app, config={"CACHE_TYPE": "SimpleCache"})
|
cache = Cache(app, config={"CACHE_TYPE": "SimpleCache"})
|
||||||
|
|
||||||
|
app.config['SESSION_COOKIE_SECURE'] = True # Only send cookie over HTTPS
|
||||||
|
app.config['SESSION_COOKIE_HTTPONLY'] = True # Prevent JavaScript access
|
||||||
|
app.config['SESSION_COOKIE_SAMESITE'] = 'Lax' # Adjust for cross-site requests
|
||||||
|
app.config['PERMANENT_SESSION_LIFETIME'] = 60 * 60 * 24 * 365 # 1 year in seconds
|
||||||
|
|
||||||
|
@app.before_request
|
||||||
|
def make_session_permanent():
|
||||||
|
session.permanent = True
|
||||||
|
|
||||||
@app.route('/manifest.json')
|
@app.route('/manifest.json')
|
||||||
def serve_manifest():
|
def serve_manifest():
|
||||||
return send_file('manifest.json', mimetype='application/manifest+json')
|
return send_file('manifest.json', mimetype='application/manifest+json')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user