Skip to content

Commit d7534cd

Browse files
committed
Enhance documentation regarding read operations
1 parent ef3c946 commit d7534cd

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,16 @@ Read all visible cookies:
9595
Cookies.get(); // => { name: 'value' }
9696
```
9797

98+
*Note: It is not possible to read a particular cookie by passing one of the cookie attributes (which may or may not
99+
have been used when writing the cookie in question):*
100+
101+
```javascript
102+
Cookies.get('foo', domain: { 'sub.example.com' }); // `domain` won't have any effect...!
103+
```
104+
105+
The cookie with the name `foo` will only be available on `.get()` if it's visible from where the
106+
code is called; the domain and/or path attribute will not have an effect when reading.
107+
98108
Delete cookie:
99109

100110
```javascript

0 commit comments

Comments
 (0)