You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using session.data_serializer=json produces the following error (full stack trace below):
TypeError: Object of type datetime is not JSON serializable
Details
The _expires attribute is set on a CookieSession to a datetime object here
When that cookie is serialized to json, an error is through as datetimes are not JSON serializable
This error seems to only occur after the 2nd time a cookie is .save()d: only after the first .save() the _expires attribute is set to a datetime on the cookie and then subsequent uses of the cookie fail at serialization.
Overview
Using
session.data_serializer=json
produces the following error (full stack trace below):Details
_expires
attribute is set on aCookieSession
to adatetime
object herejson
, an error is through asdatetime
s are not JSON serializable.save()
d: only after the first.save()
the_expires
attribute is set to adatetime
on the cookie and then subsequent uses of the cookie fail at serialization.Reproducible Example
Test Case
Flask
localhost:5000
-> expect to load fine the first timeFull Stack Trace
The text was updated successfully, but these errors were encountered: