Cookie expire at Session instead of date. #5042
-
Hi everyone, I create a cookie this way in flask set_cookie('aName','aValue',expires=unixepoch,samesite="Strict",secure=True,httponly=True)
Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
I can't reproduce the issue as described. Setting a cookie with an expires date in the future does persist it across browser sessions. Be sure to include a reproducible example when asking a question. |
Beta Was this translation helpful? Give feedback.
-
Thanks @davidism Here a more complete example @app.route('/anEndpoint', methods=['GET', 'POST'])
def anEndpoint():
resp = make_response(redirect('/'))
resp.set_cookie('aName','aValue',expires=unixepoch,samesite="Strict",secure=True,httponly=True)
return resp |
Beta Was this translation helpful? Give feedback.
-
That Internet browser had in the options "Clear cookies etc.. when closing.." so the browser was setting all cookies and any other storage as "session expire" |
Beta Was this translation helpful? Give feedback.
That Internet browser had in the options "Clear cookies etc.. when closing.." so the browser was setting all cookies and any other storage as "session expire"