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.
Environment
Linux
v18.15.0
3.5.1
2.4.1
npm@9.5.0
vite
srcDir
,modules
,session
,robots
,security
,vite
,image
,i18n
,nitro
,telemetry
,algolia
,app
,schemaOrg
,auth
,viewport
,css
,build
,runtimeConfig
@nuxtjs/tailwindcss@6.7.0
,genesis-design-system/nuxt
,@nuxtjs/algolia@1.7.0
,nuxt-viewport@2.0.4
,@nuxtjs/partytown@1.3.0
,@vueuse/nuxt@9.13.0
,nuxt-schema-org@2.1.3
,nuxt-icon@0.4.1
,@pinia/nuxt@0.4.11
,@nuxtjs/i18n@8.0.0-beta.12
,@sidebase/nuxt-auth@0.5.0
,@nuxtjs/robots@3.0.0
,nuxt-security@0.13.0
,@sidebase/nuxt-session@0.2.7
,@nuxt/image-edge@1.0.0-28059208.2abef1b
-
Reproduction
I cant create stackblitz environment with nuxt-session https://stackblitz.com/edit/nuxt-starter-xntdla
Describe the bug
When i use nuxt-session first, time with cookies / localStorage cleaned, i launch some route/api fetch.
In the Node part, the session dont shared between request, in any request the sessionId is created.
When first request is finished, created the sessionId cookie and runs ok.
FIRST REQUEST WITHOUT sessionIdCookie:
NEXT REQUEST WITH sessionIDCookie:
src/server/routes/fapi/[...].ts
export default defineEventHandler(async (event:H3Event) => { let session = event.context.session.id console.log('session', session)
Additional context
No response
Logs
No response