1.0.3 • Published 3 years ago
js-cook v1.0.3
JS-Cook Package
Install
npm install js-cook
Classes
Cookie
Cookie {
attributes : {
name: name of the cookie
value: value of the cookie
expires: When this cookie expires
path: The root of this cookie
HttpOnly: Whether this cookie has the HttpOnly flag set
Secure: Whether this cookie has the Secure flag set
}
methods : {
constructor(name = undefined, value = undefined, expire = undefined, path = undefined, domain = undefined, HttpOnly = false, Secure = false) : creates a new cookie object
createRaw : creates a string for this cookie using its attributes
save : adds this cookie to the document.cookie
}
}
Usage
Require package
import jsCook from 'js-cook';
Create new cookie
let cookie = jsCook.newCookie();
console.log(cookie);