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

Defined in

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

Properties

domain

private domain: string

Defined in

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


request

protected request: ApiRequest

Defined in

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


response

protected response: ApiResponse<IncomingMessage>

Defined in

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


secure

private secure: boolean

Defined in

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


octetRegExp

private readonly static octetRegExp: RegExp

Defined in

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

Defined in

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

Defined in

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

Defined in

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

Defined in

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


remove()

remove(name: string): void

Parameters

ParameterType
namestring

Returns

void

Defined in

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


encodeCookieOctet()

private static encodeCookieOctet(value: string): string

Parameters

ParameterType
valuestring

Returns

string

Defined in

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