Skip to content

Cookies

This content is for v8.x. Switch to the latest version for up-to-date documentation.

Options for the cookie module used to keep track of various User-Agent states. The options maxAge and expires are ignored. Use ttl.Session and ttl.Interaction to configure the ttl and in turn the cookie expiration values for Session and Interaction models.

Keygrip Signing keys used for cookie signing to prevent tampering. You may also pass your own KeyGrip instance.

recommendation: Rotate regularly (by prepending new keys) with a reasonable interval and keep a reasonable history of keys to allow for returning user session cookies to still be valid and re-signed

default value:

[]

Options for long-term cookies

recommendation: set cookies.keys and cookies.long.signed = true

default value:

{
httpOnly: true,
sameSite: 'none'
}

Cookie names used to store and transfer various states.

default value:

{
interaction: '_interaction',
resume: '_interaction_resume',
session: '_session'
}

Options for short-term cookies

recommendation: set cookies.keys and cookies.short.signed = true

default value:

{
httpOnly: true,
sameSite: 'lax'
}