-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
Handle cookies options #113
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
yea i have this same issue when i tried setting 2 cookies
I migrated from sveltekit endpoint to trpc and this was working on sveltekit but on trpc all the options were missing, also it seems its only able to set 1 cookie and not multiple this this fix it? |
Yes, it should be working now. Try updating and see how it goes |
I just tried the new version, the options seem to be passing, but it still only supports 1 cookie :( it looks like the set-cookie is combined into 1 header
so that the browser doesnt recognize it. I think sveltekit breaks it up into 2 set-cookie headers |
You're right! Can you provide an example of the headers SvelteKit generates with multiple cookies? |
Created a new PR for that! With that fix it works fine for me, but you can try it yourself and give your feedback! |
The previous proxy that was used to edit SvelteKit cookies did not take in account the cookies options.
This still does not have the exact same behaviour as the SvelteKit implementation, but should be the same for most cases. Using the default implementation would require access to the internal API.
I also fixed a bug where old cookies were set again for every request.
Cookies now also have
Path: /
by default, instead ofPath: /trpc
.