flask-session
flask-session copied to clipboard
After calling session.clear() the Expiry attribute stops being returned
Example code:
from flask import Flask, session
from flask_session import Session
app = Flask(__name__, static_url_path="")
app.config["SESSION_TYPE"] = "filesystem"
app.config["SESSION_PERMANENT"] = True
app.config["PERMANENT_SESSION_LIFETIME"] = 30 * 86400
Session(app)
@app.route("/test_working")
def test_working():
return "", 200
@app.route("/test_not_working")
def test_not_working():
session.clear()
session["x"] = "y"
return "", 200
app.run()
When requesting /test_working
I get the following header, which contains the Expires
attribute as expected:
set-cookie: session=a40be61f-164a-47d3-b3dc-77a7fd4c66a4; Expires=Thu, 03-Sep-2020 21:12:53 GMT; HttpOnly; Path=/
However, when requesting /test_not_working
the Expires
attribute is missing:
set-cookie: session=69bb7ea7-a8d5-4a9c-be64-9295b1545f88; HttpOnly; Path=/
I'm observing the same behavior (flask-session 0.3.2)
same behaviour 21/10/2021
Fixed post 0.7.0rc1