Wrong typing for expires in set_cookie
See original GitHub issueI think the type for https://github.com/encode/starlette/blob/55b0cbd045269a28a3f1b18f32ae3cb47226ab65/starlette/responses.py#L108
This should be a date according to https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie
So I think a better type is Optional[str]
, or Optional[str | datetime] and provide the right formatting.
Issue Analytics
- State:
- Created a year ago
- Comments:14 (9 by maintainers)
Top Results From Across the Web
SetCookie::expire does not work: missing Domain part #23
I have tested it with Firefox 49.0.1 and Chrome 53.0.2785.143 and both behave in the same (standard?) way: the minimum requirement for expiring...
Read more >Express doesn't set a cookie - node.js - Stack Overflow
I had the same issue. The server response comes with cookie set: Set-Cookie:my_cookie=HelloWorld; Path=/; Expires=Wed, 15 Mar 2017 15:59:59 GMT.
Read more >setcookie - Manual - PHP
For instance, time()+60*60*24*30 will set the cookie to expire in 30 days. Another option is to use the mktime() function. If set to...
Read more >Set-Cookie - HTTP - MDN Web Docs
Permanent cookies are removed at a specific date ( Expires ) or after a specific length of time ( Max-Age ) and not...
Read more >setcookie
This is internally achieved by setting value to 'deleted' and expiration time to one year in past. Because setting a cookie with a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have the feeling we had this discussion before… Need to find where. 🤔
EDIT: Maybe not? EDIT2: It was not discussed before.
Why is it unlikely?