A small javascript utility to make handling cookies simple

Downloads in past


6601.0.14 years ago5 years agoMinified + gzip package size for simplecookie in KB


simpleCookie buld status

A small utility to make handling cookies simple

307 bytes minified & gzipped


After minifying/uglifying simpleCookie.js

Setting a cookie

_smplCke.set('test', {'foo' : 'bar', 1 : true}, 'Thu, 18 Dec 2019 12:00:00 UTC', '/login');
Parameters one and two are mandatory, three and four are optional, and default to session and / respectively. The value of a cookie can be a string or an object.

Getting a cookie

If the value of the cookie is an object, an object will be returned. Otherwise, this will return a string.

Deleting a cookie


Finding a cookie'test')
Will return true or false


This library is meant to provide a minimal API, which can be extended upon by the user if needed. With that in mind, please do not submit pull requests containing additional features, unless they allow for necessary functionality which is not currently provided.