class RequestCookieStore
implements CookieStore
import { RequestCookieStore } from "https://deno.land/x/shed@v0.1.0-pre.10/request-cookie-store.ts";
An implementation of the Cookie Store API for request handlers.
It uses the Cookie
header of a request to populate the store and
keeps a record of changes that can be exported as a list of Set-Cookie
headers.
Note that this is not a polyfill! It is intended as a cookie middleware for Cloudflare Workers, and perhaps some other uses.
Constructors
new
RequestCookieStore(request: Request)Methods
addEventListener(): void
_type: string,
_listener: EventListenerOrEventListenerObject,
_options?: boolean | AddEventListenerOptions,
delete(name: string): Promise<void>
delete(options: CookieStoreDeleteOptions): Promise<void>
dispatchEvent(_event: Event): boolean
get(name?: string): Promise<CookieListItem | null>
get(options?: CookieStoreGetOptions): Promise<CookieListItem | null>
getAll(name?: string): Promise<CookieList>
getAll(options?: CookieStoreGetOptions): Promise<CookieList>
removeEventListener(): void
_type: string,
_callback: EventListenerOrEventListenerObject,
_options?: boolean | EventListenerOptions,
set(name: string, value: string): Promise<void>
set(options: CookieInit): Promise<void>
Exports the entire cookie store as a cookie
header string
Static Methods
deprecated
toSetCookie(cookie: CookieInit): stringHelper to turn a single CookieInit
into a set-cookie
string.