diff --git a/README.md b/README.md index 5215778..c323ef0 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ # Overview : -An Javascript Client-side API that handles adding, getting & removing cookies to/from `document.cookie`. +A Javascript Client-side API that handles adding, getting & removing cookies to/from `document.cookie`. It handles also complex data structure. Indeed, You can persist not only `String` but also `Objects` in `document.cookie`. diff --git a/package.json b/package.json index f6ec294..292e84e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "chocolata", - "version": "1.0.0", + "version": "1.0.1", "description": "Cookies Management in the browser (document.cookie) which supports complex data structure (objects) not only Strings ", "main": "index.js", "scripts": { diff --git a/src/Chocolata.js b/src/Chocolata.js index bd8b895..7d129a6 100644 --- a/src/Chocolata.js +++ b/src/Chocolata.js @@ -13,7 +13,7 @@ class Chocolata { static getStringItem(name) { var nameEQ = name + '='; - var ca = document.cookie.split(';'); + var ca = document.cookie.split(';').reverse(); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1, c.length);