Are you uninterested in the “doc.cookie” aspect?
Do you need to have full management over cookies? in a easy method?
Remember to get the most effective resolution on the market, make your life simpler!
To donate and or get private help purchase jsCookie right here on Codecanyon.
To get the open supply model head to github: https://github.com/agam360/jsCookie
- Replace 1.four: –  .
- 1 New perform getNamesByValue().
- Modified getAsArray() to return an object literal.
- Code enhancements (lint checks and extra).
- Up to date Documentation.
- Replace 1.three: –  .
- three New features ( replace(), appendValue() & getSettings() ).
- Up to date Documentation.
- Minor Code enhancements.
- Replace 1.2 : After a number of complaints about errors, I made a decision to replace jsCookie –  .
- Run-time errors – mounted!
- Dev instrument up to date.
- Higher integration with jQuery
- The primary main replace, code-named “jsCookie-1.1”. -Achieved!
- Minifyied model of jsCookie.(2.74okay”b as an alternative of 5.78okay”b)
- Up to date documentation.
- Developer instrument that checks jsCookie’s features.
- Repair for the prototype object. :)-Achieved!
jsCookie.create("identify","worth",[0,1,0,0]); //create a cookie that expires in 1 hour console.log(jsCookie.learn("identify"));//outputs: "worth"
jsCookie is designed for speedy improvement and ease of use.
Each drawback will be solved simply with the documentation.
Suitable with all main internet browsers!
Light-weight and straightforward to implement!
“Went forward and picked this up and I’m so glad I did! Labored completely!”
“One thing I’ve waited a very long time. Thanks very a lot!”
“Helpful and easy-to-use cookie library, glorious e-mail help, thanks Agam.”
“This library is unquestionably price having & straightforward to make use of.”
This script and Agam’s assist/distinctive buyer help was prime notch from begin to end!
Don’t dwell on shopping for from this creator, he’s certain to be an elite creator very quickly!
1) Embrace jsCookie into your html file:
Simply copy this code into your html file and paste it earlier than the closing “head” tag or the closing “physique” tag.
2) Name jsCookie
Within the script tag the place you need to use jsCookie, add the next traces:
(earlier than utilizing the jsCookie features, in any other case it won’t have time to load)
var jsc = new jsCookie();
three) Begin coding!
- .enabled() – examine the provision of cookies on the shopper’s browser.
- .create() – creates or updates a cookie.
- .set() – creates a session cookie which exists solely whereas the browser window stays open.
- .learn() – returns the worth of the desired cookie.
- .readByValue() – returns the identify of the cookie’s worth that was specified.
- .take away() – deletes a cookie by it’s identify.
- .removeByValue() – deletes a cookie by its worth.
- .removeAll() – deletes all of the cookies (solely these within the present path).
- .rely() – returns the variety of cookies on the web page.
- .getNames() – returns all of the cookies’ names within the present web page.
- .getValues() – returns all of the cookie values within the present web page.
- .replace() – replace cookies whereas sustaining their outdated settings.
- .appendValue() -append values to already current cookies.
- .getSettings() – learn and updatable cookie’s settings (expire date, path, area, safe).
- Replace 1.four:
- .getAsArray() – returns cookies and their information as an array or object literal.
- .getNamesByValue() – get cookies names by their widespread worth
Utilizing with a jQuery fasion:
1) Add the next line to the tip of: jsCookie-1.four.min.js
$.jscookie = jsCookie.prototype;
2) Use jsCookie like so: