Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the Document</title> </head> <body> <script> // +3 days from now let date = new Date(Date.now() + 3); date = date.toUTCString(); document.cookie = "user=Jack; expires=" + date; alert(document.cookie); </script> </body> </html>