Taxum / @taxum/cookie / PrivateJar
Class: PrivateJar
Defined in: private.ts:17
A child cookie jar that provides authenticated encryption for its cookies.
A private child jar signs and encrypts all the cookies added to it and verifies and decrypts cookies retrieved from it. Any cookies stored in the PrivateJar
are simultaneously assured confidentiality, integrity and authenticity. In other words, clients cannot discover nor tamper with the contents of a cookie, nor can they fabricate cookie data.
Methods
add()
add(
cookie
):void
Defined in: private.ts:51
Adds a Cookie to the parent jar.
The cookie's value is encrypted with authenticated encryption assuring confidentially, integrity and authenticity.
Parameters
cookie
Returns
void
See
get()
get(
name
):null
|Cookie
Defined in: private.ts:38
Returns a Cookie with the name name
from the parent jar.
It authenticates and decrypts the cookie's value, returning a Cookie
with the decrypted value. If the cookie cannot be found, or the cookie fails to authenticate or decrypt, null
is returned.
Parameters
name
string
Returns
null
| Cookie
See
remove()
remove(
cookie
):void
Defined in: private.ts:63
Removes a Cookie from the parent jar.
For correct removal, the passed in cookie
must contain the same path
and domain
as the cookie that was initially set.
Parameters
cookie
Returns
void