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
Specifying the expires attribute when setting a cookie on an endpoint causes the Netlify Adapter to emit two set-cookie headers (neither with expiry) instead of one single header with the designated expiry. More specifically, a header like this:
set-cookie: flavor=chocolate%20chip; Expires=Wed, 23 Feb 2022 17:17:53 GMT
Gets converted into this:
set-cookie: flavor=chocolate%20chip; Expires=Wed
set-cookie: 23 Feb 2022 17:17:53 GMT
I suspect that the Netlify handler code is too simple, as it splits the set-cookie header at every comma. Since the date format requires a comma per the date specification, this means expiry gets split by the adapter.
I have deployed a tiny app on Netlify showcasing the issue. It allows you to attempt to set and unset a flavor cookie, and if you observe the network request/response in the developer tools, you can see the cookie is not set correctly.
Describe the bug
Specifying the
expires
attribute when setting a cookie on an endpoint causes the Netlify Adapter to emit twoset-cookie
headers (neither with expiry) instead of one single header with the designated expiry. More specifically, a header like this:Gets converted into this:
I suspect that the Netlify handler code is too simple, as it splits the
set-cookie
header at every comma. Since the date format requires a comma per the date specification, this means expiry gets split by the adapter.The code under suspicion:
Reproduction
I have deployed a tiny app on Netlify showcasing the issue. It allows you to attempt to set and unset a
flavor
cookie, and if you observe the network request/response in the developer tools, you can see the cookie is not set correctly.Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
No response
The text was updated successfully, but these errors were encountered: