Bugfix: set_cookie datetime#292
Conversation
4fba852 to
5be7ff4
Compare
|
What is the issue with setting expires in the past? AFAIK this is a common technique for clearing a cookie. |
|
@mmerickel: There is |
|
I can change the warning message, expires is going away in the future anyway. Setting max_age to 0 is a better idea. |
|
Yeah this is a little wishy washy but it sort of feels like something webob shouldn't have an opinion on. |
|
If you don't think it is a good idea, I can remove that warning. I only added it late last night because of the local time vs utc time issue and maybe a warning would be nice, I have no opinion either way. |
This will convert the TZ aware datetime to one that is not timezone aware and to UTC. This can then be used in math to generate the timedelta for max_age. Also documents that using a local datetime object is not supported, unfortunately there is no good way to find out whether a datetime is local or not, so there is no way to warn the user about bad input. Closes #254
5be7ff4 to
ceb4ade
Compare
This fixes the bug reported by @dobesv in #254. Also documents that
expiresshould not be a localtime, and that it should not be set in the past.