Skip to main content

Function: addCookie

▸ addCookie(name, value?, crypt?, ttl?, path?): Promise<void>

Add a browser cookie (created on the browser side)

Parameters​

NameTypeDefault valueDescription
namestringundefined: name of the cookie
value?stringundefined: value of the cookie
cryptbooleantrue: encrypt the cookie (not usable by the server)
ttl?numberundefined: time to live of the cookie (in seconds)
pathstring'/': scope of the cookie

Returns​

Promise<void>

Defined in​

onekijs/packages/onekijs-framework/src/utils/storage.ts:13