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
Delete a cookie valid to the path of the current page:
73
76
74
-
// Need to use the same path, domain and secure attributes that were used when writing the cookie
75
-
Cookies.set('name', 'value', { path:'/' });
77
+
```javascript
78
+
Cookies.set('name', 'value', { path:'' });
76
79
Cookies.remove('name'); // fail!
77
-
Cookies.remove('name', { path:'/' }); // removed!
80
+
Cookies.remove('name', { path:'' }); // removed!
78
81
```
79
82
80
83
*IMPORTANT! 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).*
@@ -137,7 +140,7 @@ Cookie attributes defaults can be set globally by setting properties of the `Coo
137
140
138
141
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.
139
142
140
-
**Browser default:** Cookie is removed when the user closes the browser.
143
+
**Default:** Cookie is removed when the user closes the browser.
141
144
142
145
**Examples:**
143
146
@@ -151,14 +154,14 @@ Cookies.remove('name');
151
154
152
155
Define the path where the cookie is available.
153
156
154
-
**Browser default:**Path of the page where the cookie was created
157
+
**Default:**`/`
155
158
156
159
**Examples:**
157
160
158
161
```javascript
159
-
Cookies.set('name', 'value', { path:'/' });
162
+
Cookies.set('name', 'value', { path:'' });
160
163
Cookies.get('name'); // => 'value'
161
-
Cookies.remove('name', { path:'/' });
164
+
Cookies.remove('name', { path:'' });
162
165
```
163
166
164
167
**Note regarding Internet Explorer:**
@@ -173,7 +176,7 @@ This means one cannot set a path using `path: window.location.pathname` in case
173
176
174
177
Define the domain where the cookie is available
175
178
176
-
**Browser default:** Domain of the page where the cookie was created
179
+
**Default:** Domain of the page where the cookie was created
177
180
178
181
**Examples:**
179
182
@@ -186,7 +189,7 @@ Cookies.get('name'); // => undefined (need to read at 'sub.domain.com')
186
189
187
190
A `Boolean` indicating if the cookie transmission requires a secure protocol (https)
188
191
189
-
**Browser default:** No secure protocol requirement
0 commit comments