Method | Description | parameters |
---|---|---|
save(value, options) | Saves a cookie with custom expiration, path, secure flag, and SameSite attribute. | `value: any, options: CookieOptions` |
get() | Retrieves and parses the cookie value. Returns a promise. | `none` |
remove() | Deletes the cookie by setting an expired date. | `none` |
Method | Description | parameters |
---|---|---|
duration | Expiration of the cookie in years, months, and/or days. | `{ years?: number, months?: number, days?: number }` |
path | Path where the cookie is available. Defaults to '/' | `string` |
secure | If true, cookie will only be sent over HTTPS. | `boolean` |
sameSite | Controls cross-site access. Can be 'Strict', 'Lax', or 'None' | `'Strict' | 'Lax' | 'None'` |