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
Copy file name to clipboardExpand all lines: 6-data-storage/01-cookie/article.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ Cookies are usually set by a web-server using response `Set-Cookie` HTTP-header.
7
7
One of the most widespread use cases is authentication:
8
8
9
9
1. Upon sign in, the server uses `Set-Cookie` HTTP-header in the response to set a cookie with a unique "session identifier".
10
-
2. Next time when the request is set to the same domain, the browser sends the cookie over the net using `Cookie` HTTP-header.
10
+
2. Next time when the request is sent to the same domain, the browser sends the cookie over the net using `Cookie` HTTP-header.
11
11
3. So the server knows who made the request.
12
12
13
13
We can also access cookies from the browser, using `document.cookie` property.
@@ -96,7 +96,7 @@ Usually, we should set `path` to the root: `path=/` to make the cookie accessibl
96
96
97
97
A domain where the cookie is accessible. In practice though, there are limitations. We can't set any domain.
98
98
99
-
By default, a cookie is accessible only at the domain that set it. So, if the cookie was set by `site.com`, we won't get it `other.com`.
99
+
By default, a cookie is accessible only at the domain that set it. So, if the cookie was set by `site.com`, we won't get it at `other.com`.
100
100
101
101
...But what's more tricky, we also won't get the cookie at a subdomain `forum.site.com`!
102
102
@@ -404,7 +404,7 @@ Websites generally have two variants of following GDPR. You must have seen them
404
404
405
405
2. If a website wants to set tracking cookies for everyone.
406
406
407
-
To do so legally, a website shows a modal "splash screen" for newcomers, and require them to agree for cookies. Then the website can set them and let people see the content. That can be disturbing for new visitors though. No one likes to see "must-click" modal splash screens instead of the content. But GDPR requires an explicit agreement.
407
+
To do so legally, a website shows a modal "splash screen" for newcomers, and requires them to agree for cookies. Then the website can set them and let people see the content. That can be disturbing for new visitors though. No one likes to see "must-click" modal splash screens instead of the content. But GDPR requires an explicit agreement.
408
408
409
409
410
410
GDPR is not only about cookies, it's about other privacy-related issues too, but that's too much beyond our scope.
0 commit comments