cookies-worker
v1.0.15
Published
Package for coockies working
Downloads
27
Readme
Cookie-worker
${DESCRIPTION}
Install
npm i -s cookies-worker
Usage
Script tag
<script src="./node_modules/cookies-worker/cookiesWorker.js"></script>
adding to the global scope cookiesWorker object
Setting cookie
cookiesWorker.setCookie('test','test',{
expieres: 10
})
First parameter - name, Second - value, Additional options for cookie:
{
expires:<number, date>,
path: <string>,
domain: <string>,
secure: <boolean>
}
Get cookie by name
cookiesWorker.getCookie('name');
Delete cookie by name
cookiesWorker.deleteCookie('name');
Get all cookies
cookiesWorker.getAllCookies();
return value object
Clear all cookies
cookiesWorker.clearAllCookies();