Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the Document</title> </head> <body> <script> // cookie will disappear +2 hour from now document.cookie = "user=Jack; max-age=7200"; alert(document.cookie); // delete cookie,let it expire right now document.cookie = "user=Jack; max-age=0"; alert(document.cookie); </script> </body> </html>