Skip to content

Commit 9228f25

Browse files
Small change in the RFC section
1 parent b94993a commit 9228f25

1 file changed

Lines changed: 6 additions & 13 deletions

File tree

‎README.md‎

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,10 @@ Delete cookie:
6262
Cookies.remove('name'); // => true
6363
Cookies.remove('nothing'); // => false
6464

65-
// IMPORTANT!
6665
// Need to use the same path, domain and secure attributes that were used when writing the cookie
6766
Cookies.set('name', 'value', { path: '/' });
68-
69-
// This won't work!
70-
Cookies.remove('name'); // => false
71-
72-
// This will work!
73-
Cookies.remove('name', { path: '/' }); // => true
67+
Cookies.remove('name'); // This won't work!
68+
Cookies.remove('name', { path: '/' }); // This will work!
7469
```
7570

7671
*Note: when deleting a cookie, you must pass the exact same path, domain and secure attributes that were used to set the cookie, unless you're relying on the [default attributes](#cookie-attributes).*
@@ -105,12 +100,10 @@ Cookies.getJSON('name'); // => { foo: 'bar' }
105100
Cookies.getJSON(); // => { name: { foo: 'bar' } }
106101
```
107102

108-
## RFC 6265
109-
110-
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.
103+
## Encoding
111104

112-
### Encoding
113-
All special characters that are not allowed in the cookie-value or cookie-name in at least one supported browser are encoded/decoded with each UTF-8 Hex equivalent. Special characters that consistently work among all supported browsers are not encoded/decoded this way.
105+
This project is [RFC 6265](http://tools.ietf.org/html/rfc6265#section-4.1.1) compliant.
106+
However, all special characters that are not allowed in the cookie-value or cookie-name are encoded/decoded with each UTF-8 Hex equivalent. Special characters that consistently work among all supported browsers are not encoded/decoded this way.
114107

115108
## Cookie Attributes
116109

@@ -120,7 +113,7 @@ Cookie attributes defaults can be set globally by setting properties of the `Coo
120113

121114
Define when the cookie will be removed. Value can be a `Number` which will be interpreted as days from time of creation or a `Date` instance. If omitted, the cookie becomes a session cookie.
122115

123-
**Browser default:** Removed when the user closes the browser.
116+
**Browser default:** Cookie is removed when the user closes the browser.
124117

125118
**Examples:**
126119

0 commit comments

Comments
 (0)