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 2847ee7
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+10-2Lines changed: 10 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,18 +82,26 @@ When creating a cookie you can pass an Array or Object Literal instead of a stri
82
82
Cookies.set('name', { foo:'bar' });
83
83
```
84
84
85
-
When reading a cookie with the default `Cookies.get()` api, you receive the stringified representation stored in the cookie:
85
+
When reading a cookie with the default `Cookies.get` api, you receive the stringified representation stored in the cookie:
86
86
87
87
```javascript
88
88
Cookies.get('name'); // => '{"foo":"bar"}'
89
89
```
90
90
91
-
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 (if available):
91
+
```javascript
92
+
Cookies.get(); // => { name: '{"foo":"bar"}' }
93
+
```
94
+
95
+
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 (if available):
92
96
93
97
```javascript
94
98
Cookies.getJSON('name'); // => { foo: 'bar' }
95
99
```
96
100
101
+
```javascript
102
+
Cookies.getJSON(); // => { name: { foo: 'bar' } }
103
+
```
104
+
97
105
## RFC 6265
98
106
99
107
This project assumes [RFC 6265](http://tools.ietf.org/html/rfc6265#section-4.1.1) as a reference for everything. That said, some custom rules are applied in order to provide robustness and cross-browser compatibility.
0 commit comments