pallets-eco / flask-session

Server side session extension for Flask
https://flask-session.readthedocs.io
BSD 3-Clause "New" or "Revised" License
507 stars 238 forks source link

Fixed error that can occur if document.get('expiration') returns None #77

Closed ronsmith closed 8 months ago

ronsmith commented 7 years ago

Not sure how my session got into this state but this change allows for a graceful recovery instead of an exception.

christopherpickering commented 1 year ago

A cleaner way would probably to add a default value to the get().

Lxstr commented 8 months ago

This was likely from setting permanent to False which from 0.7.0 should no longer affect the serverside expiry. Previously some backends were not setting an expiry for non-permanent sessions, which has obvious implications for storage. All now do in accordance with PERMANENT_SESSION_LIFETIME. Anyone who really wants a non expiring session can just set this to a huge value.

Also mongo backend now uses time-to-live based on the expiry field

Lxstr commented 8 months ago

No longer needed.