Skip to main content

Share sessions across sub domains

Sharing sessions across multiple sub domains in SuperTokens can be configured by setting the sessionScope attribute of the Session recipe in your frontend code.


  • Your app has two subdomains and We assume that the user logs in via
  • To enable sharing sessions across, and the sessionsScope attribute must be set to
import SuperTokens from "supertokens-auth-react";import Session from "supertokens-auth-react/recipe/session";
SuperTokens.init({    appInfo: {        // ...        // this should be equal to the domain where the user will see the login UI        apiDomain: "...",        appName: "...",        websiteDomain: ""    },    recipeList: [        Session.init({            sessionScope: ""        })    ]});

Do not set sessionScope to a value that's in the public suffix list (Search for your value without the leading dot). Otherwise session management will not work.

What type of UI do you want to use?
Custom UI
Pre built UI