vn-cookie
v1.0.1
Published
Cookie use on client
Downloads
2
Readme
// set cookie user_id and user_name with time 10 days
cookie.init({day: 10, path: "/"}).set({user_id: 1, user_name: "Nguyen Thuan"});
// check cookie
if(cookie.has("user_id")) console.log("We have cookie user_id = " + cookie.get("user_id"));
else console.log("Have no cookie user_id");
// get cookie
var user_id = cookie.get("user_id");
// delete cookie
cookie.remove(["user_id", "user_name"]);