Skip to content
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

Create a cookie from a string #13680

Open
while1618 opened this issue Apr 4, 2025 · 2 comments · May be fixed by #13681
Open

Create a cookie from a string #13680

while1618 opened this issue Apr 4, 2025 · 2 comments · May be fixed by #13681
Labels
feature / enhancement New feature or request

Comments

@while1618
Copy link

while1618 commented Apr 4, 2025

Describe the problem

As discussed here #8564, when you call an external api which sets a cookie, it would be nice to just pass that cookie from the form action down to the client. Currently, you need to parse the cookie string with some custom parser or by adding set-cookie-parser dependency to your project, and then you can create the cookie with cookies.set().

It would be nice if you can just pass that cookie string to a method like cookies.setFromString(cookie).

Describe the proposed solution

Since svelte-kit already have set-cookie-parser dependency, it would be easy to just parse that string and call cookies.set() on extracted values.

I already created this, here is the PR #13681. So, does this feature request make sense? Will you consider merging?

P.S. my first PR here, so if I didn't follow every rule, pls forgive me.

Alternatives considered

No response

Importance

would make my life easier

Additional Information

No response

@eltigerchino eltigerchino linked a pull request Apr 7, 2025 that will close this issue
6 tasks
@eltigerchino eltigerchino added the feature / enhancement New feature or request label Apr 7, 2025
@while1618
Copy link
Author

Hey @eltigerchino, any update on this? Will you consider merging it? You need any changes in my PR?

@eltigerchino
Copy link
Member

looks good to me but I'd wait for another maintainer to review it as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature / enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants