Blog Post
Using cookies in JavaScript

Cookies are small items of data, each consisting of a name and value,
stored on behalf of a website by visitors’ web browsers. In JavaScript, cookies can be accessed through the document.Cookies.js is a JavaScript object that allows cookies to be created, retrieved, and deleted through a simple and intuitive interface.
Download Cookies.js files below and use for cookies.

how to SetCookie:


For create cookies set 2 parameter cookie name and parameter.
The value of the property can be either a date on which the cookie will expire or a number of seconds after which the cookie should expire:

Cookies.set('theme', 'green', {expiry : 3600});

if you want cookies to access only one domain then
Cookies.set(‘name’, ‘Shilpa’, {expiry : new Date(2030, 0, 1)});

Retrieving Cookies

if you retrive, cookies value then,

var theme = Cookies.get('color');

Deleting cookies

if you delete cookies value then,


For detailed please see

Tags In
February 15, 2019

Leave an reply

Your email address will not be published. Required fields are marked *