We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7159c60 commit 8f0e73dCopy full SHA for 8f0e73d
part9 (Advanced Topics)/client-side-storage/cookies.js
@@ -0,0 +1,18 @@
1
+/*
2
+INFO: Cookies
3
+Small pieces of data stored in the browser and sent with every HTTP request to the same origin
4
+
5
+INFO: Key features:
6
+1. Small (max-4KB)
7
+2. Used for authentication, tracking, etc.
8
+3. Can have expiration, domain, path, and secure flags
9
+4. Accessible via document.cookie.
10
+*/
11
12
+document.cookie = "username=rafay; expires=Fri, 31 Dec 2025 23:59:59 GMT; path=/";
13
14
+console.log(document.cookie); // "username=rafay"
15
16
+document.cookie = "username=admin";
17
18
+document.cookie = "username=; expires=Thu, 01 Jan 1970 00:00:00 UTC;";
0 commit comments