pallets-eco / flask-session

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

Fixed: If the expiration = None #55

Closed yuryatr closed 7 years ago

fengsp commented 7 years ago

Why there is not expiration in the document?

yuryatr commented 7 years ago

If the permanent == False the expires is set to None

get_expiration_time method.

expires = self.get_expiration_time(app, session)

Here "expires" is None

Therefore error.

    if document and document.get('expiration') <= datetime.utcnow():
TypeError: can't compare datetime.datetime to NoneType
fengsp commented 7 years ago

Flask-Session only works when permanent is True, if you need non-permanent session, use the builtin cookie session.