Skip to main content

CookieOptions

@webda/core


Class: CookieOptions

Defined in: packages/core/src/session/cookie.ts:18

Cookie Options

Implements​

  • Omit<CookieSerializeOptions, "domain">

Constructors​

Constructor​

new CookieOptions(options, httpContext?): CookieOptions

Defined in: packages/core/src/session/cookie.ts:74

Load with default value

Parameters​

options​

Partial<CookieOptions>

the options

httpContext?​

HttpContext

the HTTP context

Returns​

CookieOptions

Properties​

_maxAge?​

optional _maxAge?: Duration

Defined in: packages/core/src/session/cookie.ts:35

Duration storage


domain?​

optional domain?: string | true

Defined in: packages/core/src/session/cookie.ts:30

if true domain will be set to the request hostname if undefined no domain will be output (browser will use the current domain and only this one) if a string is provided it will be used as the domain

When provided a domain is setting the cookie to be available to all subdomains


httpOnly?​

optional httpOnly?: boolean

Defined in: packages/core/src/session/cookie.ts:57

Default​

true

Implementation of​

Omit.httpOnly


name?​

optional name?: string

Defined in: packages/core/src/session/cookie.ts:67

Name of the cookie


path?​

optional path?: string

Defined in: packages/core/src/session/cookie.ts:53

Default​

/

Implementation of​

Omit.path


sameSite?​

optional sameSite?: "none" | "strict" | "lax"

Defined in: packages/core/src/session/cookie.ts:22

Default​

lax

Implementation of​

Omit.sameSite


secure?​

optional secure?: boolean

Defined in: packages/core/src/session/cookie.ts:63

If not set will be true if https request and false otherwise If defined it will be set to the value

Default​

undefined

Implementation of​

Omit.secure

Accessors​

maxAge​

Get Signature​

get maxAge(): number

Defined in: packages/core/src/session/cookie.ts:47

Get the max age in seconds, defaulting to 7 days

Returns​

number

the result number

Set Signature​

set maxAge(value): void

Defined in: packages/core/src/session/cookie.ts:40

Minimum​

1

Default​
7d
Parameters​
value​

string | number

Returns​

void

Implementation of​

Omit.maxAge