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
188 stars 19 forks source link

The session cookie is not created in Safari #80

Closed josesotelo2degrees closed 1 year ago

josesotelo2degrees commented 1 year ago

Environment


Reproduction

Copy example from the documentation and test it in Safari

Describe the bug

I have created a session with the example from the documentation, and it works fine in Chrome and Firefox, but it does not work in any recent Safari version. I got Safari 16.4 (18615.1.26.11.22).

const { session, refresh, remove, reset, update, overwrite } = await useSession(); await update({ "hello": "session", "test": 1234, "userLikesCookies": true });

I was able to create the cookie using:

const user = useCookie( 'userInfo', { default: () => ({ score: -1 }), watch: false } )

I am not sure if I need to tune the default configuration to make it work in Safari or if it is a bug.

Thanks...

Additional context

No response

Logs

No response

josesotelo2degrees commented 1 year ago

Hi Guys, In case anyone is having the same issue. In order to create the http cookie , the application needs to run under https in localhost. https://www.storyblok.com/faq/setting-up-https-on-localhost-in-nuxt-3