Skip to content

Commit d560bce

Browse files
committed
minor
1 parent fa50e7f commit d560bce

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

6-data-storage/01-cookie/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ We leave it as an exercise for the reader. Also, at the end of the chapter you'l
3939

4040
## Writing to document.cookie
4141

42-
We can write to `document.cookie`. But it's not a data property, it's an accessor. An assignment to it is treated specially.
42+
We can write to `document.cookie`. But it's not a data property, it's an accessor (getter/setter). An assignment to it is treated specially.
4343

44-
**A write operation to `document.cookie` passes through the browser that updates cookies mentioned in it, but doesn't touch other cookies.**
44+
**A write operation to `document.cookie` updates only cookies mentioned in it, but doesn't touch other cookies.**
4545

4646
For instance, this call sets a cookie with the name `user` and value `John`:
4747

@@ -52,7 +52,7 @@ alert(document.cookie); // show all cookies
5252

5353
If you run it, then probably you'll see multiple cookies. That's because `document.cookie=` operation does not overwrite all cookies. It only sets the mentioned cookie `user`.
5454

55-
Technically, name and value can have any characters, but to keep the formatting valid they should be escaped using a built-in `encodeURIComponent` function:
55+
Technically, name and value can have any characters, to keep the valid formatting they should be escaped using a built-in `encodeURIComponent` function:
5656

5757
```js run
5858
// special values, need encoding

figures.sketch

31 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)