npm install @rentspree/cookie
run
npm version patch
- setOption
- addChangeListener
- removeChangeListener
- setLocalItem
- getLocalItem
- getAllLocalItem
- removeLocalItem
- removeAllLocalItem
Set options for the to be stored cookies.
options
Object (optional, default{}
)
Add a listener to when a cookie is set or removed.
callback
function
Remove a listener from the change callback.
callback
function
Set a cookie value.
Get a cookie value.
Returns any cookie or false if cookie is not found.
Get all cookies.
options
Object (optional, default{}
)
Returns all cookies.
Remove a cookie.
Remove all cookies that has the same prefix as the parameter.
prefix
string Prefix of the cookie to be removed