Fix problem with wrong "expires" format #268
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The format passed to strftime is incorrect and does not work with some browsers. It's better to pass datetime object to Django, which will handle formatting date correctly
Summary of change
I removed the
.strftime(...)part converting datetime to string in incorrect way when passed to the functionset_cookiein DjangoHttpResponseobjectAs a side-effect of the change, Django will add "Max-Age" parameter to every "Set-Cookie" header. I believe it's not a problem, however, to change this behavior, one should add
strftime(...)back with correct date formatRelated issues
Test Plan
I've applied the change and tested it with my server. The cookies are sent with correct date format now. Sign out now works for the browser where it didn't work before (any Webkit-based browser, Gnome Web for example).
Documentation changes
Not relevant
Checklist for important updates
coreDriverInterfaceSupported.jsonfile has been updated (if needed)supertokens_python/constants.pyfrontendDriverInterfaceSupported.jsonfile has been updated (if needed)setup.pysupertokens_python/constants.pygit tag) in the formatvX.Y.Z, and then find the latest branch (git branch --all) whoseX.Yis greater than the latest released tag.supertokens_python/utils.pyfile to include that in theFRAMEWORKSvariableRemaining TODOs for this PR