Skip to content

Instantly share code, notes, and snippets.

@ovaillancourt
Created April 4, 2012 19:43
Show Gist options
  • Save ovaillancourt/2305053 to your computer and use it in GitHub Desktop.
Save ovaillancourt/2305053 to your computer and use it in GitHub Desktop.
Configuring express session store to work across subdomain
app.use(express.cookieParser());
app.use(express.session({
secret: 'MySecret', //Should be the same across all the apps that share the same sessions.
store: Bla, //Init your store here
cookie: {domain: '.mydomain.com'} //The point in front here is important so that the same sessions work across all sub-domains.
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment