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 9228f25
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+6-13Lines changed: 6 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,15 +62,10 @@ Delete cookie:
62
62
Cookies.remove('name'); // => true
63
63
Cookies.remove('nothing'); // => false
64
64
65
-
// IMPORTANT!
66
65
// Need to use the same path, domain and secure attributes that were used when writing the cookie
67
66
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!
74
69
```
75
70
76
71
*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).*
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
111
104
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.
114
107
115
108
## Cookie Attributes
116
109
@@ -120,7 +113,7 @@ Cookie attributes defaults can be set globally by setting properties of the `Coo
120
113
121
114
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.
122
115
123
-
**Browser default:**Removed when the user closes the browser.
116
+
**Browser default:**Cookie is removed when the user closes the browser.
0 commit comments