Home > tough-cookie > MemoryCookieStore > putCookie
Adds a new Cookie to the store. The implementation SHOULD replace any existing cookie with the same domain
, path
, and key
properties.
Signature:
putCookie(cookie: Cookie, callback: ErrorCallback): void;
Parameter |
Type |
Description |
---|---|---|
cookie |
The cookie to store. | |
callback |
A function to call when the cookie has been stored or an error has occurred. |
void
-
Depending on the nature of the implementation, it's possible that between the call to
fetchCookie
andputCookie
that a duplicateputCookie
can occur. -
The Cookie object MUST NOT be modified; as the caller has already updated the
creation
andlastAccessed
properties.