-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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 are not being set when returning custom Response
objects in handle
#7611
Comments
This is a deliberate decision. |
Is it wrong to reset So having an "apply-cookies" process for everything At least a warning would be really useful when a custom |
+1 - this shot me in the foot for a while.. |
Describe the bug
When returning custom
Response
objecs inside thehandle
function of thehooks.server
file, all interactions with theevent.cookies
parameter get ignored.In order to properly set cookies, somewone would need to manually specify them in the
headers
object.I would expect that cookies are beeing set even if someone returns a custom Response object.
When using
events.cookies.set
afterresolve
we will get an error message.But I think it makes sense also to support that use case and allow cookies beeing set after the rendering process.
Reproduction
https://github.com/ivanhofer/sveltekit-request-cookie-bug
custom
cookie does not get appliedLogs
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: