-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cookies from middleware don't get set on custom 404 page #7880
Comments
You shared a reproduction, but you didn't specify how we can reproduce the issue. I opened the link but I am really sure what I am supposed to. |
FYI, when calling |
I just tried to read the cookie from the 404, and it's correctly set. |
@ematipico Thank you for the tip for adding I am sorry if the repro wasn't self explanatory enough. ![]() |
Looks like this has been fixed in Astro 2.9.7 by #7754. Please upgrade Please see minimal reproduction. |
The issue still exists on 2.9.7. Looking at the minimal repro, the cookies are indeed added to the I think this issue needs to be reopened. |
What version of
astro
are you using?2.9.6
Are you using an SSR adapter? If so, which one?
Node
What package manager are you using?
npm
What operating system are you using?
Mac
What browser are you using?
Safari
Describe the Bug
When cookies are being set in middleware (using
Astro.cookies.set
), but the page request resolves to a (custom) 404 page, the cookies don't get set/send.What's the expected result?
Even when a page resolves to 404, cookies must be able to be set from middleware.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-bpkd5t?file=src%2Fmiddleware.ts
Participation
The text was updated successfully, but these errors were encountered: