sidebase / nuxt-session

Nuxt session middleware to get a persistent session per app user, e.g., to store data across multiple requests. The nuxt session module provides the useSession() composable out of the box and sets up API endpoints to interact with your session to make working with sessions feel like a breeze.
https://sidebase.io/nuxt-session/
MIT License
189 stars 19 forks source link

Allow configurable cookie domain property #19

Closed blumgart closed 1 year ago

blumgart commented 1 year ago

Describe the feature

I have two subdomains:

and the problem is this - from frontend.example.com no cookies are passed to backend.example.com. I need to send sessionId to Strapi and save to database.

If you add the domain: ".example.com" property, then the cookies are sent as expected.

https://github.com/sidebase/nuxt-session/blob/5cbbad4b0a7b5c4d721f72b8507c007c10e67d5b/src/runtime/server/middleware/session/index.ts#L9-L18

Additional information

No response

BracketJohn commented 1 year ago

Yeah, we'll support that!

Do you want to have a try at implementing this? Else we can take over (: