Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

🍪 Lightweight, simple and easy cookie management library in JavaScript

License

Notifications You must be signed in to change notification settings

iamalperen/cookie-manager-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cookie-manager-js

Lightweight, simple and easy cookie management library in JavaScript

Packagist PyPI

This is a library for providing more useful and powerful interface to manage your cookies.

  • No Dependency
  • Supports AMD, CommonJS and Node modules
  • Lightweight 1 KB
  • Supported by all browsers

Installation

Download the cookie-manager.min.js and include in your project.

<script src="cookie-manager.min.js"></script>

Usage

After include the cookie-manager.min.js, you will be able to use CookieManager object.

You can also load CookieManager object as an AMD, CommonJS or Node module

Functionalities

Creating a Cookie

Creating a new cookie

  CookieManager.set(name, value, expires, domain, path, secure);
  • name (String) cookie name
  • value (String) cookie value
  • expires (Optional) (Number) cookie expiration in days
  • domain (Optional) (String) cookie domain
  • path (Optional) (String) cookie path
  • secure (Optional) (Boolean) cookie ssl support flag

Retrieving a Cookie

Getting a cookie with given cookie name

  CookieManager.get(name);
  • name (String) cookie name

Updating a Cookie

Updating an existing cookie

  CookieManager.update(name, value, expires, domain, path, secure);
  • name (String) cookie name
  • value (String) cookie value
  • expires (Optional) (Number) cookie expiration in days
  • domain (Optional) (String) cookie domain
  • path (Optional) (String) cookie path
  • secure (Optional) (Boolean) cookie ssl support flag

Deleting a Cookie

Deleting a cookie with given cookie name

  CookieManager.remove(name);
  • name (String) cookie name

Listing All Cookies

Returns all of the existing cookies

  CookieManager.getAll();

Clearing All Cookies

Clears all of the existing cookies

  CookieManager.clear();

Author and License

Created and maintained by Alperen under MIT License

About

🍪 Lightweight, simple and easy cookie management library in JavaScript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages