Documents / @faasjs/http / Session
Class: Session<S, C>
Type Parameters
• S extends Record
<string
, string
> = any
• C extends Record
<string
, string
> = any
Constructors
new Session()
new Session<
S
,C
>(cookie
,config
):Session
<S
,C
>
Parameters
• cookie: Cookie
<C
, S
>
• config: SessionOptions
Returns
Session
<S
, C
>
Methods
decode()
decode<
TData
>(text
):SessionContent
|TData
Type Parameters
• TData = any
Parameters
• text: string
Returns
SessionContent
| TData
encode()
encode(
text
):string
Parameters
• text: SessionContent
Returns
string
invoke()
invoke(
cookie
?,logger
?):void
Parameters
• cookie?: string
• logger?: Logger
Returns
void
read()
read(
key
):string
|number
Parameters
• key: string
Returns
string
| number
update()
update():
Session
<S
,C
>
Returns
Session
<S
, C
>
write()
write(
key
,value
?):Session
<S
,C
>
Parameters
• key: string
• value?: string
| number
Returns
Session
<S
, C
>
Properties
config
readonly
config:object
cipherName
cipherName:
string
digest
digest:
string
iterations
iterations:
number
key
key:
string
keylen
keylen:
number
salt
salt:
string
secret
secret:
string
signedSalt
signedSalt:
string
content
content:
Record
<string
,string
|number
>