dahas / cookie_management
Easy cookie handling.
Installs: 33
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 1
Language:JavaScript
Requires
- components/jquery: ^3.1
This package is not auto-updated.
Last update: 2024-03-16 17:10:04 UTC
README
A script to easily handle cookies.
Requirements
- jQuery
Usage
- Include the file after the jQuery library:
<script src="[your_path]/cookie_mgmt.js" type="text/javascript"></script>
- Make an instance:
var Cookie = new Cookie(name[, expDays, path]);
- Adding a value to the cookie (creates cookie, if it doesn´t exist):
Cookie.set(parameter, value);
- Reading a paramter from the cookie:
Cookie.get(parameter);
- Deleting a parameter and its value (removes the cookie, if no further parameters exist):
Cookie.clear(parameter);
- Remove the cookie:
Cookie.remove();
License
MIT