1.1.6 • Published 4 years ago
ts-simple-cookie v1.1.6
ts-simple-cookie
ts-simple-cookie is a simple, easy to use package for managing cookies. To use this package, simply create a new instance of Cookie. Here is an example:
import { Cookie } from "ts-simple-cookie";
const myCookie = new Cookie();
// Creates a new cookie
myCookie.create("newCookie", "12345", {
expires: "Wed, 25 Jun 2020 12:00:00 UTC",
});
// Edits an existing cookie
myCookie.edit("newCookie", "newValue", {
expires: "Thu, 26 Jun 2020 12:00:00 UTC",
});
// Returns the value of an existing cookie
const valueOfCookie = myCookie.get("newCookie");
// Deletes an existing cookie
myCookie.delete("newCookie");