Skip to content

Commit 4005ea2

Browse files
Document the path valid to the current page
Now that the defaults are changed, we invert the documentation to assume visibility in the whole site by default and document handling a cookie valid to the path of the current page.
1 parent 4aa5023 commit 4005ea2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ Delete cookie:
7272
Cookies.remove('name');
7373
```
7474

75-
Delete cookie passing the attributes:
75+
Delete a cookie valid to the path of the current page:
7676

7777
```javascript
78-
Cookies.set('name', 'value', { path: '/foo' });
78+
Cookies.set('name', 'value', { path: '' });
7979
Cookies.remove('name'); // fail!
80-
Cookies.remove('name', { path: '/foo' }); // removed!
80+
Cookies.remove('name', { path: '' }); // removed!
8181
```
8282

8383
*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).*
@@ -159,9 +159,9 @@ Define the path where the cookie is available.
159159
**Examples:**
160160

161161
```javascript
162-
Cookies.set('name', 'value', { path: '/foo' });
162+
Cookies.set('name', 'value', { path: '' });
163163
Cookies.get('name'); // => 'value'
164-
Cookies.remove('name', { path: '/foo' });
164+
Cookies.remove('name', { path: '' });
165165
```
166166

167167
**Note regarding Internet Explorer:**

0 commit comments

Comments
 (0)