Skip to main content

Class: CookieStore

Extends

  • Map<string, string>

Constructors

new CookieStore()

new CookieStore(request: ApiRequest, response: ApiResponse<IncomingMessage>, secure: boolean, domainOverwrite?: null | string): CookieStore

Parameters

ParameterType
requestApiRequest
responseApiResponse<IncomingMessage>
secureboolean
domainOverwrite?null | string

Returns

CookieStore

Overrides

Map<string, string>.constructor

Source

projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:14

Properties

domain

private domain: string

Source

projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:11


request

protected request: ApiRequest

Source

projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:9


response

protected response: ApiResponse<IncomingMessage>

Source

projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:10


secure

private secure: boolean

Source

projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:12


octetRegExp

private static readonly octetRegExp: RegExp

Source

projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:125

Methods

add()

add(name: string, value: string, options?: SecureCookieStoreSetOptions): void

Parameters

ParameterType
namestring
valuestring
options?SecureCookieStoreSetOptions

Returns

void

Source

projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:45


getHostDomain()

private getHostDomain(host: string): string

Parses a host using the tldts library to extract the domain. This is used for the domain of the cookie

Parameters

ParameterTypeDescription
hoststringThe hot to parse

Returns

string

Either the host in all lower case or the parsed domain, ready for use on cookies

Source

projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:110


insert()

protected insert(name: string, entry: string): void

Parameters

ParameterType
namestring
entrystring

Returns

void

Source

projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:53


prepare()

protected prepare(name: string, value: string, __namedParameters: SecureCookieStoreSetOptions): string

Parameters

ParameterType
namestring
valuestring
__namedParametersSecureCookieStoreSetOptions

Returns

string

Source

projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:68


remove()

remove(name: string): void

Parameters

ParameterType
namestring

Returns

void

Source

projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:49


encodeCookieOctet()

private static encodeCookieOctet(value: string): string

Parameters

ParameterType
valuestring

Returns

string

Source

projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:127