-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Cookie not set when response is rewritten (experimental.rewriting) #11265
Comments
I'm sorry, I checked the reproduction, and I don't get it. From the index I need to go to the page /1. Why would I need to expect to see a cookie that was never set? (The index doesn't set any cookies) |
The initial console.log would be expected to be But went through this - #11247 (comment). I think it's the same issue. Cannot manipulate the request once it's been consumed. I was expecting the cookie to be set as page /2 (to which /1 is rewritten to) does so. But I guess the |
Can you make sure to leave proper instructions in the reproduction, so we will be able to triage it and give a proper answer? That issue is about the body of the request, which behaves differently from headers. |
Added instructions. |
Thanks @atej ! |
@ascorbic some context on this one (you may know some or most of this already, sorry): The As a result, there used to be a different ways to set I believe (you will want to research to confirm) that now In any case, the likely cause of this bug is that |
I think you're right, and |
Looking at it a but I think there are too many public methods that expect the current behaviour to make it a safe refactor right now. Maybe in Astro 5 it can be simplified. For now I'll fix the immediate issue. |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Using
Astro.cookie.set
does not actually set a cookie for a rewritten request.What's the expected result?
A cookie should be set.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-xcsrpa?file=src%2Fpages%2F1.astro
Participation
The text was updated successfully, but these errors were encountered: