Functions

Session cookie options

Example HTTPS policy; cookie protections do not replace session verification, CSRF defenses or revocation. Source: https://nextjs.org/docs/app/guides/authentication

Formal Syntax & Structure

nextjs syntaxnextjs
{ httpOnly: true, secure: true, sameSite: "lax", path: "/", maxAge: 900 }

Working Example

Example Snippetnextjs
// Policy fragment for an approved HTTPS auth integration; no token issuedconst sessionCookieOptions = { httpOnly:true, secure:true, sameSite:'lax' as const, path:'/', maxAge: 15*60};console.log(sessionCookieOptions.maxAge);
Next.js Reference