Documents / @faasjs/http / Cookie
Class: Cookie<C, S>
Type Parameters
• C extends Record
<string
, string
> = any
• S extends Record
<string
, string
> = any
Constructors
new Cookie()
new Cookie<
C
,S
>(config
,logger
?):Cookie
<C
,S
>
Parameters
• config: CookieOptions
• logger?: Logger
Returns
Cookie
<C
, S
>
Methods
headers()
headers():
object
Returns
object
Set-Cookie?
optional
Set-Cookie:string
[]
invoke()
invoke(
cookie
,logger
):Cookie
<C
,S
>
Parameters
• cookie: string
• logger: Logger
Returns
Cookie
<C
, S
>
read()
read(
key
):any
Parameters
• key: string
Returns
any
write()
write(
key
,value
,opts
?):Cookie
<C
,S
>
Parameters
• key: string
• value: string
• opts?
• opts.domain?: string
• opts.expires?: string
| number
• opts.httpOnly?: boolean
• opts.path?: string
• opts.sameSite?: "Strict"
| "Lax"
| "None"
• opts.secure?: boolean
Returns
Cookie
<C
, S
>
Properties
config
readonly
config:object
domain?
optional
domain:string
expires
expires:
number
httpOnly
httpOnly:
boolean
path
path:
string
sameSite?
optional
sameSite:"Strict"
|"Lax"
|"None"
secure
secure:
boolean
session
session:
SessionOptions
content
content:
Record
<string
,string
>
logger
logger:
Logger
session
session:
Session
<S
,C
>