Skip to content

Latest commit

 

History

History
75 lines (36 loc) · 1.33 KB

tough-cookie.memorycookiestore.putcookie_1.md

File metadata and controls

75 lines (36 loc) · 1.33 KB

Home > tough-cookie > MemoryCookieStore > putCookie

MemoryCookieStore.putCookie() method

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;

Parameters

Parameter

Type

Description

cookie

Cookie

The cookie to store.

callback

ErrorCallback

A function to call when the cookie has been stored or an error has occurred.

**Returns:**

void

Remarks

  • Depending on the nature of the implementation, it's possible that between the call to fetchCookie and putCookie that a duplicate putCookie can occur.

  • The Cookie object MUST NOT be modified; as the caller has already updated the creation and lastAccessed properties.