You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ffbe93b
Browse filesBrowse the repository at this point in the historyBrowse files
js-cookie provides unobstrusive JSON storage for cookies.
97
97
98
-
When creating a cookie you can pass an Array or Object Literal instead of a string in the value. If you do so, js-cookie store the string representation of the object according to the `JSON.stringify` api:
98
+
When creating a cookie you can pass an Array or Object Literal instead of a string in the value. If you do so, js-cookie store the string representation of the object according to `JSON.stringify`:
99
99
100
100
```javascript
101
101
Cookies.set('name', { foo:'bar' });
102
102
```
103
103
104
-
When reading a cookie with the default `Cookies.get` api, you receive the stringified representation stored in the cookie:
104
+
When reading a cookie with the default `Cookies.get` api, you receive the string representation stored in the cookie:
When reading a cookie with the `Cookies.getJSON` api, you receive the parsed representation of the string stored in the cookie according to the `JSON.stringify` api:
114
+
When reading a cookie with the `Cookies.getJSON` api, you receive the parsed representation of the string stored in the cookie according to `JSON.parse`:
0 commit comments