Skip to main content

CookieConfig

The Express SDK exports CookieConfig and SESSION_COOKIE_NAME for the session cookie behavior used by the SDK.

Import

const {CookieConfig, SESSION_COOKIE_NAME} = require('@thunderid/express');
ExportValueDescription
SESSION_COOKIE_NAME'THUNDERID_SESSION_ID'Session cookie key used by the Express SDK
PropertyValue
defaultExpirySeconds86400
defaultHttpOnlytrue
defaultSameSite'lax'
defaultSecurefalse

Usage

You do not need to set these values directly when sessionCookie options are omitted from ExpressClientConfig. The SDK uses these defaults automatically.

index.js
const {SESSION_COOKIE_NAME} = require('@thunderid/express');

app.get('/session-id', (req, res) => {
res.json({sessionId: req.cookies?.[SESSION_COOKIE_NAME] ?? null});
});
ThunderID LogoThunderID Logo

Product

DocsAPIsSDKs
© WSO2 LLC. All rights reserved.