pixelmund / svelte-kit-cookie-session

⚒️ Encrypted "stateless" cookie sessions for SvelteKit
MIT License
182 stars 11 forks source link

Subdomain Support #23

Closed impactvelocity closed 2 years ago

impactvelocity commented 2 years ago

I am trying to make the session cookie work with subdomains. Right now it's setting the cookie with 'subdomain.localhost', and I would like to set it to the root domain so I can support sessions over subdomains.

How can I do this? :)

Love this package so far!

pixelmund commented 2 years ago

Hey i think your problem is solvable. Check out this cookie options.

 export const handle = handleSession({ cookie: { domain: "root.com" } })

You might be able to set the domain to your root domain. But i'm not 100% sure. Maybe you'll have to play around with the samesite option too.

impactvelocity commented 2 years ago

Oh great!! I will give that a try!