Keep login sessions server-side in Databunker Pro — encrypted, expiring and revocable — and hand the browser only a random ID.
A session is how your application remembers a logged-in user between requests: a record on the server, found by a random ID that the browser sends in a cookie. Developers routinely keep customer details in it — email, name, IP address, device — so the session store ends up holding personal data. Those same details are what a security team relies on to spot a hijacked session and investigate an incident, so they need to be both protected and available.A session that lives in a signed cookie or a JWT cannot be taken back: logging out deletes the browser’s copy, and anyone who copied it first keeps a working credential until it expires. A server-side session can be revoked, but it usually sits in a table nobody thinks of as sensitive.Databunker Pro provides an API that developers use to store sessions in the vault, encrypted like user records. The browser gets a random UUID; the session data is encrypted with its own record key; expiry is enforced by the vault; and one call ends the session everywhere it was used.
At login your backend generates a UUID and calls SessionUpsert with the session data.
The backend sets that UUID as a cookie. Nothing else reaches the browser.
On every request the backend calls SessionGet. A 404 means the session expired or was deleted — treat the user as logged out.
At logout the backend calls SessionDelete.
Every call comes from your backend with a server-side access token. SessionUpsert requires an admin token, so sessions cannot be created from the browser.Sessions are kept in Redis when REDIS_HOST is set and in the database otherwise. The API and behaviour are the same either way.
Generate the session ID on the server — never accept one from the client, or an attacker can plant a known ID before the victim logs in (session fixation). It must be a UUID.To link the session to a user, put one of token, login, email, phone or custom inside sessiondata. Without it the session still works, but it is not attached to anyone and log out everywhere cannot find it.
after this long without a SessionGet — each read restarts it
15–30 minutes
finaltime
at this point no matter how active the session is
8–24 hours
slidingtime alone lets an active session — or a stolen one being replayed — live forever. finaltime alone logs users out mid-task. With neither, the session never expires.finaltime is capped by policy.max_session_retention_period in databunker.yaml. The shipped file sets 1h, so a finaltime of 12h is silently cut to one hour until you raise it:
policy: max_session_retention_period: "12h"
Durations are a number with an optional unit: s seconds, h hours, d days and m months — not minutes. "30m" is 30 months. Write 30 minutes as "1800" or "1800s".
finaltime in the response is when the session will expire if it is not used again. A 404 means it has expired or been deleted: clear the cookie and send the user to log in.Comparing the stored ip or agent with the current request is a cheap way to spot a replayed cookie. Decide what a mismatch means for your users before enforcing it — mobile networks change IPs often.
When a user logs in from an anonymous session, completes MFA, or switches into an admin role, create a session under a new UUID and delete the old one. An ID that was seen before the change cannot be used after it.
In the list, session data is under data, not sessiondata. The same response can back an “active sessions” page that shows each device and when it was last used.Only sessions linked to the user — through token, login, email, phone or custom in sessiondata — appear here.
Keep session data small: the user token, what you need to detect replay, and flags such as an MFA step completed. Load the profile with UserGet when you need it rather than copying it into the session, where it goes stale. Never store a password or a password hash in a session.Deleting a user also deletes every session linked to them, so an erased user is logged out on the next request.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Databunker","colors":{"primary":"#2563eb","light":"#89A3EB","dark":"#2563eb"},"favicon":"https://mintcdn.com/databunker-a1572a73/B-htEe-_kSIkJWgA/favicon.svg?fit=max\u0026auto=format\u0026n=B-htEe-_kSIkJWgA\u0026q=85\u0026s=e31d4332c3209711f45814b25b737be6","navbar":{"links":[{"href":"https://github.com/securitybunker/databunker","label":"GitHub"}],"primary":{"type":"button","label":"Book a Demo","href":"https://cal.com/databunker-team/30min?overlayCalendar=true"}},"footer":{"socials":{"github":"https://github.com/securitybunker","linkedin":"https://www.linkedin.com/company/72703407"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"databunker-a1572a73","hasAudioNarration":false,"actualSubdomain":"databunker-a1572a73","customDomains":["docs.databunker.org"],"gitSource":{"type":"github","owner":"securitybunker","repo":"databunkerpro-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6aecc42c423e32f52d43b8b9","collectionId":"0c0e73f1-1649-4bd7-8adc-44837f01c3ca","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6aecc42c423e32f52d43b8b9"},"entitlements":{},"buildId":"6aecc42c423e32f52d43b8b9","clientVersion":"0.0.4071","searchFilterCounts":[{"language":"default","tag":"Databunker Pro","count":144},{"language":"default","tag":"API Reference","count":101},{"language":"default","tag":"Databunker OSS","count":63},{"language":"default","tag":"Reference","count":58},{"language":"default","tag":"Guides","count":48},{"language":"default","tag":"Consent","count":16},{"language":"default","tag":"User Tokenization","count":16},{"language":"default","tag":"User","count":13},{"language":"default","tag":"Get started","count":12},{"language":"default","tag":"User App","count":12}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"pro/howtos/session-management","slug":"/pro/howtos/session-management","pageMetadata":{"title":"Secure session management","sidebarTitle":"Session management","description":"Keep login sessions server-side in Databunker Pro — encrypted, expiring and revocable — and hand the browser only a random ID.","href":"/pro/howtos/session-management"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Keep login sessions server-side in Databunker Pro — encrypted, expiring and revocable — and hand the browser only a random ID.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Tab,Table,Tabs,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`A session is how your application remembers a logged-in user between requests: a record on the server, found by a random ID that the browser sends in a cookie. Developers routinely keep customer details in it — email, name, IP address, device — so the session store ends up holding personal data. Those same details are what a security team relies on to spot a hijacked session and investigate an incident, so they need to be both protected and available.`}),`\n`,_jsx(_components.p,{children:`A session that lives in a signed cookie or a JWT cannot be taken back: logging out deletes the browser’s copy, and anyone who copied it first keeps a working credential until it expires. A server-side session can be revoked, but it usually sits in a table nobody thinks of as sensitive.`}),`\n`,_jsx(_components.p,{children:`Databunker Pro provides an API that developers use to store sessions in the vault, encrypted like user records. The browser gets a random UUID; the session data is encrypted with its own record key; expiry is enforced by the vault; and one call ends the session everywhere it was used.`}),`\n`,_jsx(Heading,{level:`2`,id:`how-it-works`,children:`How it works`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`At login your backend generates a UUID and calls `,_jsx(_components.code,{children:`SessionUpsert`}),` with the session data.`]}),`\n`,_jsx(_components.li,{children:`The backend sets that UUID as a cookie. Nothing else reaches the browser.`}),`\n`,_jsxs(_components.li,{children:[`On every request the backend calls `,_jsx(_components.code,{children:`SessionGet`}),`. A `,_jsx(_components.code,{children:`404`}),` means the session expired or was deleted — treat the user as logged out.`]}),`\n`,_jsxs(_components.li,{children:[`At logout the backend calls `,_jsx(_components.code,{children:`SessionDelete`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Every call comes from your backend with a server-side access token. `,_jsx(_components.code,{children:`SessionUpsert`}),` requires an admin token, so sessions cannot be created from the browser.`]}),`\n`,_jsxs(_components.p,{children:[`Sessions are kept in Redis when `,_jsx(_components.code,{children:`REDIS_HOST`}),` is set and in the database otherwise. The API and behaviour are the same either way.`]}),`\n`,_jsx(Heading,{level:`2`,id:`create-a-session-at-login`,children:`Create a session at login`}),`\n`,_jsx(_components.p,{children:`Generate the session ID on the server — never accept one from the client, or an attacker can plant a known ID before the victim logs in (session fixation). It must be a UUID.`}),`\n`,_jsxs(_components.p,{children:[`To link the session to a user, put one of `,_jsx(_components.code,{children:`token`}),`, `,_jsx(_components.code,{children:`login`}),`, `,_jsx(_components.code,{children:`email`}),`, `,_jsx(_components.code,{children:`phone`}),` or `,_jsx(_components.code,{children:`custom`}),` inside `,_jsx(_components.code,{children:`sessiondata`}),`. Without it the session still works, but it is not attached to anyone and `,_jsx(_components.a,{href:`#log-out-everywhere`,children:`log out everywhere`}),` cannot find it.`]}),`\n`,_jsxs(Tabs,{children:[_jsx(Tab,{title:`curl`,id:`curl`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`13`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`13`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://your-databunker/v2/SessionUpsert`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-Bunker-Token: YOUR_ACCESS_TOKEN\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"sessionuuid\": \"6f1c2a7e-4b8d-4e2f-9a31-0c5d7e8f9a10\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"sessiondata\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"token\": \"USER_TOKEN\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"ip\": \"203.0.113.7\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"agent\": \"Mozilla/5.0 (Macintosh; ...)\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"slidingtime\": \"1800\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"finaltime\": \"12h\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})})}),_jsx(Tab,{title:`JavaScript`,id:`javascript`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`randomUUID`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"node:crypto\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` sessionId`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` randomUUID`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` api`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`upsertSession`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` sessionId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`token:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` userToken`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ip:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` req`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ip`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`agent:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` req`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`get`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"user-agent\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`slidingtime:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"1800\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`finaltime:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"12h\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`res`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`cookie`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"sid\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`sessionId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`httpOnly:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`secure:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`sameSite:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"lax\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`]})})})}),_jsx(Tab,{title:`Python`,id:`python`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` uuid`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`session_id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(uuid.uuid4())`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`api.upsert_session(`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` session_id,`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"token\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: user_token, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ip\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: request.remote_addr, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"agent\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: request.user_agent.string},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"slidingtime\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"1800\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"finaltime\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"12h\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response.set_cookie(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"sid\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, session_id, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`httponly`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`secure`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`samesite`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Lax\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})})})]}),`\n`,_jsxs(_components.p,{children:[`Calling `,_jsx(_components.code,{children:`SessionUpsert`}),` again with the same `,_jsx(_components.code,{children:`sessionuuid`}),` replaces the data and restarts both timers.`]}),`\n`,_jsx(Heading,{level:`2`,id:`set-expiry`,children:`Set expiry`}),`\n`,_jsx(_components.p,{children:`Two timers end a session; set both.`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Parameter`}),_jsx(_components.th,{children:`Ends the session`}),_jsx(_components.th,{children:`Typical value`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`slidingtime`})}),_jsxs(_components.td,{children:[`after this long `,_jsx(_components.strong,{children:`without`}),` a `,_jsx(_components.code,{children:`SessionGet`}),` — each read restarts it`]}),_jsx(_components.td,{children:`15–30 minutes`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`finaltime`})}),_jsx(_components.td,{children:`at this point no matter how active the session is`}),_jsx(_components.td,{children:`8–24 hours`})]})]})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`slidingtime`}),` alone lets an active session — or a stolen one being replayed — live forever. `,_jsx(_components.code,{children:`finaltime`}),` alone logs users out mid-task. With neither, the session never expires.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`finaltime`}),` is capped by `,_jsx(_components.code,{children:`policy.max_session_retention_period`}),` in `,_jsx(_components.code,{children:`databunker.yaml`}),`. The shipped file sets `,_jsx(_components.code,{children:`1h`}),`, so a `,_jsx(_components.code,{children:`finaltime`}),` of `,_jsx(_components.code,{children:`12h`}),` is silently cut to one hour until you raise it:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`policy`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` max_session_retention_period`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"12h\"`})]}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Durations are a number with an optional unit: `,_jsx(_components.code,{children:`s`}),` seconds, `,_jsx(_components.code,{children:`h`}),` hours, `,_jsx(_components.code,{children:`d`}),` days and `,_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`m`}),` months — not minutes`]}),`. `,_jsx(_components.code,{children:`\"30m\"`}),` is 30 months. Write 30 minutes as `,_jsx(_components.code,{children:`\"1800\"`}),` or `,_jsx(_components.code,{children:`\"1800s\"`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`check-the-session-on-every-request`,children:`Check the session on every request`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://your-databunker/v2/SessionGet`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-Bunker-Token: YOUR_ACCESS_TOKEN\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{\"sessionuuid\": \"6f1c2a7e-4b8d-4e2f-9a31-0c5d7e8f9a10\"}'`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ok\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"sessionuuid\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"6f1c2a7e-4b8d-4e2f-9a31-0c5d7e8f9a10\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"finaltime\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1793900656`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"sessiondata\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"token\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"USER_TOKEN\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"ip\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"203.0.113.7\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"agent\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Mozilla/5.0 (Macintosh; ...)\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`finaltime`}),` in the response is when the session will expire if it is not used again. A `,_jsx(_components.code,{children:`404`}),` means it has expired or been deleted: clear the cookie and send the user to log in.`]}),`\n`,_jsxs(_components.p,{children:[`Comparing the stored `,_jsx(_components.code,{children:`ip`}),` or `,_jsx(_components.code,{children:`agent`}),` with the current request is a cheap way to spot a replayed cookie. Decide what a mismatch means for your users before enforcing it — mobile networks change IPs often.`]}),`\n`,_jsx(Heading,{level:`2`,id:`log-out`,children:`Log out`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://your-databunker/v2/SessionDelete`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-Bunker-Token: YOUR_ACCESS_TOKEN\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{\"sessionuuid\": \"6f1c2a7e-4b8d-4e2f-9a31-0c5d7e8f9a10\"}'`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The next `,_jsx(_components.code,{children:`SessionGet`}),` for that ID returns `,_jsx(_components.code,{children:`404`}),`, so a copy of the cookie is now worthless. Clear the cookie as well.`]}),`\n`,_jsx(Heading,{level:`2`,id:`rotate-the-id-when-privileges-change`,children:`Rotate the ID when privileges change`}),`\n`,_jsx(_components.p,{children:`When a user logs in from an anonymous session, completes MFA, or switches into an admin role, create a session under a new UUID and delete the old one. An ID that was seen before the change cannot be used after it.`}),`\n`,_jsx(Heading,{level:`2`,id:`log-out-everywhere`,children:`Log out everywhere`}),`\n`,_jsx(_components.p,{children:`For “sign out of all devices”, or after a password reset, list the user’s sessions and delete each one:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://your-databunker/v2/SessionListUserSessions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-Bunker-Token: YOUR_ACCESS_TOKEN\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{\"mode\": \"token\", \"identity\": \"USER_TOKEN\"}'`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ok\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"total\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"rows\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"sessionuuid\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"6f1c2a7e-...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"lastusedtime\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1793898856`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"ip\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"203.0.113.7\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"sessionuuid\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"a90e44d1-...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"lastusedtime\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1793812400`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"ip\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"198.51.100.23\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`In the list, session data is under `,_jsx(_components.code,{children:`data`}),`, not `,_jsx(_components.code,{children:`sessiondata`}),`. The same response can back an “active sessions” page that shows each device and when it was last used.`]}),`\n`,_jsxs(_components.p,{children:[`Only sessions linked to the user — through `,_jsx(_components.code,{children:`token`}),`, `,_jsx(_components.code,{children:`login`}),`, `,_jsx(_components.code,{children:`email`}),`, `,_jsx(_components.code,{children:`phone`}),` or `,_jsx(_components.code,{children:`custom`}),` in `,_jsx(_components.code,{children:`sessiondata`}),` — appear here.`]}),`\n`,_jsx(Heading,{level:`2`,id:`cookie-settings`,children:`Cookie settings`}),`\n`,_jsx(_components.p,{children:`The cookie carries only the session UUID, but it is still a bearer credential:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`HttpOnly`}),` — scripts on the page, including injected ones, cannot read it.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`Secure`}),` — sent over HTTPS only.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`SameSite=Lax`}),` (or `,_jsx(_components.code,{children:`Strict`}),`) — not sent on cross-site POSTs.`]}),`\n`,_jsxs(_components.li,{children:[`No `,_jsx(_components.code,{children:`Max-Age`}),` longer than `,_jsx(_components.code,{children:`finaltime`}),`. Expiry is enforced by the vault regardless, but a stale cookie just produces failed lookups.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`what-to-keep-in-a-session`,children:`What to keep in a session`}),`\n`,_jsxs(_components.p,{children:[`Keep session data small: the user token, what you need to detect replay, and flags such as an MFA step completed. Load the profile with `,_jsx(_components.code,{children:`UserGet`}),` when you need it rather than copying it into the session, where it goes stale. Never store a password or a password hash in a session.`]}),`\n`,_jsx(_components.p,{children:`Deleting a user also deletes every session linked to them, so an erased user is logged out on the next request.`}),`\n`,_jsx(Heading,{level:`2`,id:`next-steps`,children:`Next steps`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/pro/administration/access-control`,children:`Access control`}),` — limit what the token your backend uses for session calls can do.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/pro/administration/multi-tenancy`,children:`Multi-tenancy`}),` — sessions are scoped to the tenant of the access token.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/pro/get-started/architecture`,children:`Architecture`}),` — where Redis fits in a deployment.`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Secure session management","sidebarTitle":"Session management","description":"Keep login sessions server-side in Databunker Pro — encrypted, expiring and revocable — and hand the browser only a random ID.","href":"/pro/howtos/session-management"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"How it works","slug":"how-it-works","depth":2,"children":[]},{"title":"Create a session at login","slug":"create-a-session-at-login","depth":2,"children":[]},{"title":"Set expiry","slug":"set-expiry","depth":2,"children":[]},{"title":"Check the session on every request","slug":"check-the-session-on-every-request","depth":2,"children":[]},{"title":"Log out","slug":"log-out","depth":2,"children":[]},{"title":"Rotate the ID when privileges change","slug":"rotate-the-id-when-privileges-change","depth":2,"children":[]},{"title":"Log out everywhere","slug":"log-out-everywhere","depth":2,"children":[]},{"title":"Cookie settings","slug":"cookie-settings","depth":2,"children":[]},{"title":"What to keep in a session","slug":"what-to-keep-in-a-session","depth":2,"children":[]},{"title":"Next steps","slug":"next-steps","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"databunker-a1572a73","siteName":"Databunker","title":"Secure session management - Databunker","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-05T18:00:31.568Z","originalFileLocation":"pro/howtos/session-management.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Keep login sessions server-side in Databunker Pro — encrypted, expiring and revocable — and hand the browser only a random ID.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Databunker\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/databunker-a1572a73/AGJgVu_bVqq5sPGz/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/databunker-a1572a73/AGJgVu_bVqq5sPGz/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/databunker-a1572a73/AGJgVu_bVqq5sPGz/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/databunker-a1572a73/AGJgVu_bVqq5sPGz/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/databunker-a1572a73/AGJgVu_bVqq5sPGz/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/databunker-a1572a73/AGJgVu_bVqq5sPGz/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/databunker-a1572a73/AGJgVu_bVqq5sPGz/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/databunker-a1572a73/AGJgVu_bVqq5sPGz/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/databunker-a1572a73/AGJgVu_bVqq5sPGz/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Secure session management - Databunker\">\u003cmeta data-mint-head property=\"og:description\" content=\"Keep login sessions server-side in Databunker Pro — encrypted, expiring and revocable — and hand the browser only a random ID.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Databunker\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.databunker.org/pro/howtos/session-management\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://databunker-a1572a73.mintlify.app/_mintlify/api/og/v2?division=How-tos\u0026amp;title=Secure+session+management\u0026amp;description=Keep+login+sessions+server-side+in+Databunker+Pro+%E2%80%94+encrypted%2C+expiring+and+revocable+%E2%80%94+and+hand+the+browser+only+a+random+ID.\u0026amp;theme=358162015f197973abe65be8\u0026amp;signature=725b3a61beeaf6bb09ba5e43e00951699d3ae33fb16961529823a2ab90d1be5c\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Secure session management - Databunker\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Keep login sessions server-side in Databunker Pro — encrypted, expiring and revocable — and hand the browser only a random ID.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://databunker-a1572a73.mintlify.app/_mintlify/api/og/v2?division=How-tos\u0026amp;title=Secure+session+management\u0026amp;description=Keep+login+sessions+server-side+in+Databunker+Pro+%E2%80%94+encrypted%2C+expiring+and+revocable+%E2%80%94+and+hand+the+browser+only+a+random+ID.\u0026amp;theme=358162015f197973abe65be8\u0026amp;signature=725b3a61beeaf6bb09ba5e43e00951699d3ae33fb16961529823a2ab90d1be5c\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/databunker-a1572a73/AGJgVu_bVqq5sPGz/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Databunker\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2563eb\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.databunker.org/pro/howtos/session-management\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/pro/howtos/session-management.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.databunker.org/#organization\",\"name\":\"Databunker\",\"url\":\"https://docs.databunker.org\"},{\"@type\":\"WebSite\",\"@id\":\"https://docs.databunker.org#website\",\"name\":\"Databunker\",\"url\":\"https://docs.databunker.org\",\"publisher\":{\"@id\":\"https://docs.databunker.org/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.databunker.org/pro/howtos/session-management#webpage\",\"url\":\"https://docs.databunker.org/pro/howtos/session-management\",\"name\":\"Secure session management\",\"description\":\"Keep login sessions server-side in Databunker Pro — encrypted, expiring and revocable — and hand the browser only a random ID.\",\"dateModified\":\"2026-11-05T18:00:31.568Z\",\"isPartOf\":{\"@id\":\"https://docs.databunker.org#website\"},\"breadcrumb\":{\"@id\":\"https://docs.databunker.org/pro/howtos/session-management#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.databunker.org/pro/howtos/session-management#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"How-tos\",\"item\":\"https://docs.databunker.org/pro/howtos/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Secure session management\",\"item\":\"https://docs.databunker.org/pro/howtos/session-management\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.databunker.org/pro/howtos/session-management#article\",\"headline\":\"Secure session management\",\"name\":\"Secure session management\",\"description\":\"Keep login sessions server-side in Databunker Pro — encrypted, expiring and revocable — and hand the browser only a random ID.\",\"url\":\"https://docs.databunker.org/pro/howtos/session-management\",\"mainEntityOfPage\":{\"@id\":\"https://docs.databunker.org/pro/howtos/session-management#webpage\"},\"dateModified\":\"2026-11-05T18:00:31.568Z\",\"publisher\":{\"@id\":\"https://docs.databunker.org/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.databunker.org#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Databunker\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Databunker","nav":{"global":null,"products":[{"product":"Databunker Pro","tabs":[{"tab":"Guides","groups":[{"group":"Get started","pages":[{"title":"Databunker Pro","sidebarTitle":"Overview","href":"/pro/get-started/overview"},{"title":"Quickstart","sidebarTitle":"Quickstart","href":"/pro/get-started/quickstart"},{"title":"Performance \u0026 benchmarks","sidebarTitle":"Performance","href":"/pro/get-started/performance"},{"title":"PII Vault - PII Storage \u0026 Tokenization in Databunker Pro","sidebarTitle":"PII Data Vault","href":"/pro/get-started/pii-vault"},{"title":"Architecture","href":"/pro/get-started/architecture"},{"title":"Security overview","href":"/pro/get-started/security-overview"},{"title":"Licensing and limits","sidebarTitle":"Licensing \u0026 limits","href":"/pro/get-started/licensing"},{"title":"Frequently asked questions","sidebarTitle":"FAQ","href":"/pro/get-started/faq"}]},{"group":"Installation","pages":[{"title":"Install with Docker Compose","sidebarTitle":"Docker Compose","href":"/pro/installation/docker-compose"},{"title":"Install with Kubernetes using Helm","sidebarTitle":"Deploy using Helm charts","href":"/pro/installation/kubernetes-helm"},{"title":"Generate admin credentials","href":"/pro/installation/generate-admin-credentials"},{"title":"Unattended installation","sidebarTitle":"Unattended installation","href":"/pro/installation/unattended-installation"},{"title":"Oracle Database backend","sidebarTitle":"Oracle Database","href":"/pro/installation/oracle-database"},{"title":"Production checklist","href":"/pro/installation/production-checklist"}]},{"group":"Administration","pages":[{"title":"Master key","href":"/pro/administration/master-key"},{"title":"Wrapping key rotation","sidebarTitle":"Key rotation","href":"/pro/administration/key-rotation"},{"title":"Shamir key shares","sidebarTitle":"Shamir keys","href":"/pro/administration/shamir-keys"},{"title":"Backup and recovery","href":"/pro/administration/backup-and-recovery"},{"title":"Monitoring","href":"/pro/administration/monitoring"},{"title":"Multi-tenancy","href":"/pro/administration/multi-tenancy"},{"title":"Conditional Role-Based Access Control (CRBAC)","sidebarTitle":"Access control","href":"/pro/administration/access-control"}]},{"group":"Concepts","pages":[{"title":"Format-preserving tokenization","sidebarTitle":"Tokenization","href":"/pro/concepts/tokenization"},{"title":"File Vault","sidebarTitle":"File Vault","href":"/pro/concepts/file-vault"},{"title":"Fuzzy search","href":"/pro/concepts/fuzzy-search"},{"title":"Partial search","href":"/pro/concepts/partial-search"},{"title":"Record versioning","sidebarTitle":"Versioning","href":"/pro/concepts/record-versioning"},{"title":"Select security","href":"/pro/concepts/select-security"},{"title":"Sub-accounts","sidebarTitle":"Sub-accounts","href":"/pro/concepts/sub-accounts"},{"title":"Shared records","sidebarTitle":"Shared records","href":"/pro/concepts/shared-records"},{"title":"Multi-jurisdiction deployment","sidebarTitle":"Multi-jurisdiction deployment","href":"/pro/concepts/global-deployment"}]},{"group":"Comparisons","pages":[{"title":"AWS Cognito vs Databunker Pro — PII Vault \u0026 Tokenization","sidebarTitle":"AWS Cognito vs Databunker Pro","href":"/pro/comparisons/aws-cognito-alternative"},{"title":"HashiCorp Vault vs Databunker Pro — PII Storage \u0026 Compliance","sidebarTitle":"HashiCorp Vault vs Databunker Pro","href":"/pro/comparisons/hashicorp-vault-alternative"},{"title":"Custom PII Vault vs Databunker Pro — Build or Buy?","sidebarTitle":"Custom PII Vault vs Databunker Pro","href":"/pro/comparisons/custom-solution-alternative"}]},{"group":"Migrations","pages":[{"title":"Migrating to Databunker Pro","sidebarTitle":"Overview","href":"/pro/migrations/overview"},{"title":"Migrate a SQL users table","sidebarTitle":"SQL users table","href":"/pro/migrations/sql-users-table"},{"title":"Migrate from AWS Cognito","sidebarTitle":"AWS Cognito","href":"/pro/migrations/aws-cognito"}]},{"group":"How-tos","pages":[{"title":"How-tos overview","sidebarTitle":"Overview","href":"/pro/howtos/overview"},{"title":"Update the license key","sidebarTitle":"Update license","href":"/pro/howtos/update-license"},{"title":"Clean the users table","sidebarTitle":"Clean users table","href":"/pro/howtos/clean-users-table"},{"title":"Store user fields","sidebarTitle":"Store user fields","href":"/pro/howtos/store-user-fields"},{"title":"Tokenize PII before it reaches an LLM","sidebarTitle":"Tokenize LLM prompts","description":"Replace personal data in a prompt with Databunker Pro tokens before calling a model, then restore the real values in the response.","href":"/pro/howtos/tokenize-llm-prompts"},{"title":"Secure session management","sidebarTitle":"Session management","href":"/pro/howtos/session-management"}]},{"group":"Developer tools","pages":[{"title":"Developer tools","sidebarTitle":"Overview","description":null,"href":"/pro/developer-tools/overview"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/pro/api/overview"}]}]},{"product":"Databunker OSS","pages":[{"title":"Databunker OSS","href":"/oss/get-started/overview"}]}]},"basePath":"","title":"Secure session management - Databunker","buildId":"dpl_GZsjphRpnhWkstV12jxWNcMHFyox","deploymentId":"dpl_GZsjphRpnhWkstV12jxWNcMHFyox","dynamics":[],"chunks":[]}