Skip to main content

Class: CookieStore

@sapphire/plugin-api.CookieStore

Hierarchy

  • Map<string, string>

    CookieStore

Constructors

constructor

new CookieStore(request, response, secure, domainOverwrite?)

Parameters

NameType
requestApiRequest
responseApiResponse
secureboolean
domainOverwrite?null | string

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

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

Static Private Readonly octetRegExp: RegExp

Defined in

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

Methods

add

add(name, value, options?): void

Parameters

NameType
namestring
valuestring
options?SecureCookieStoreSetOptions

Returns

void

Defined in

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


getHostDomain

Private getHostDomain(host): string

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

Parameters

NameTypeDescription
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, entry): void

Parameters

NameType
namestring
entrystring

Returns

void

Defined in

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


prepare

Protected prepare(name, value, __namedParameters?): string

Parameters

NameType
namestring
valuestring
__namedParametersSecureCookieStoreSetOptions

Returns

string

Defined in

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


remove

remove(name): void

Parameters

NameType
namestring

Returns

void

Defined in

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


encodeCookieOctet

Static Private encodeCookieOctet(value): string

Parameters

NameType
valuestring

Returns

string

Defined in

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