diff --git a/README.md b/README.md index 80d9303c..7ba8e0c5 100644 --- a/README.md +++ b/README.md @@ -746,6 +746,24 @@ await setUserSession(event, { ... } , { Checkout the [`SessionConfig`](https://github.com/unjs/h3/blob/c04c458810e34eb15c1647e1369e7d7ef19f567d/src/utils/session.ts#L20) for all options. +## Shared session between microservices and subdomains + +To share the same session between multiple hosted applications you can set and share the same `NUXT_SESSION_PASSWORD` + +If the applications are hosted on multiple subdomains, you also need to set the `cookie.domain` environment variable: + +```ts +{ + session: { + cookie: { + domain: '' + } + } +} +``` + +This will allow h3 to decode your session cookie across every applications + ## More - [nuxt-authorization](https://github.com/barbapapazes/nuxt-authorization): Authorization module for managing permissions inside a Nuxt app, compatible with `nuxt-auth-utils`