Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the Document</title> </head> <body> <script> // at anysite.com // make the cookie accessible on any subdomain *.anysite.com: document.cookie = "user=Jack; domain=w3docs.com" // later // at forum.anysite.com alert(document.cookie); // has cookie user=Jack </script> </body> </html>