MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / setSessionCookie

Function setSessionCookie

server/src/middleware/auth.ts:552–560  ·  view source on GitHub ↗

* Helper to set the session cookie with consistent options

(res: Response, sealedSession: string)

Source from the content-addressed store, hash-verified

550 * Helper to set the session cookie with consistent options
551 */
552function setSessionCookie(res: Response, sealedSession: string) {
553 res.cookie('wos-session', sealedSession, {
554 httpOnly: true,
555 secure: process.env.NODE_ENV === 'production' && !ALLOW_INSECURE_COOKIES,
556 sameSite: 'lax',
557 path: '/',
558 maxAge: 7 * 24 * 60 * 60 * 1000, // 7 days
559 });
560}
561
562// Static admin API key for internal tooling (bypasses WorkOS)
563const ADMIN_API_KEY = process.env.ADMIN_API_KEY;

Callers 2

requireAuthFunction · 0.85
optionalAuthFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected