Skip to main content

Class: CookieStore

Defined in: projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:8

Extends

  • Map<string, string>

Constructors

new CookieStore()

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

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

Parameters

ParameterType
requestApiRequest
responseApiResponse
secureboolean
domainOverwrite?null | string

Returns

CookieStore

Overrides

Map<string, string>.constructor

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

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

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

Parameters

ParameterType
namestring
valuestring
options?SecureCookieStoreSetOptions

Returns

void


getHostDomain()

private getHostDomain(host: string): string

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

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


insert()

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

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

Parameters

ParameterType
namestring
entrystring

Returns

void


prepare()

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

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

Parameters

ParameterType
namestring
valuestring
__namedParametersSecureCookieStoreSetOptions

Returns

string


remove()

remove(name: string): void

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

Parameters

ParameterType
namestring

Returns

void


encodeCookieOctet()

private static encodeCookieOctet(value: string): string

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

Parameters

ParameterType
valuestring

Returns

string