[Nuxt/SSR] Keep Session Alive Problem

System Information
  • Strapi Version: 4.11.7
  • Operating System: W11
  • Database: Postgres
  • Node Version: v18.16.1
  • NPM Version: 9.8.1
  • Yarn Version: 0
  • Nuxt 3 Version: 3.6.5

Hello,

I am using Nuxt 3 with Strapi and working on Authentication. Register and Login is okay, but when page is refresh I can’t get user information anymore.

Tried to set “strapi_jwt” to cookies by useCookie(‘jwt’) and use it in middleware to set it “useStrapiAuth().setToken(jwt.value)” again. It works but hydration problem is occur.

Also played with strapi cookie settings in nuxt.config.ts “httpOnly: true, secure: true” but none of them worked.

I would like to know if there is better solution without any external modules needed. I want to use it in SSR mode.