I have been trying to set a cookie and use an alert to check to see if the cookie was actually set; however, it seems like it is failing to set the cookie:
Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Game Selection</title> <style> * { margin:0 auto; padding:0;} body { background-color:#CCCCCC;} #play { width:200px; border:1px solid black; text-align:center; margin-top:5px; cursor:pointer; background:white;} #play:hover { text-decoration:underline;} #bce_popup { position:absolute; top:0; left:0; background-color:black; background-color: rgba(0,0,0,0.85); width:100%; height:100%; display:none; } #bce_main { top:10px; height: 80%; width:80%; margin-top:10px; clear:both; position:absolute; display:none; background-color:transparent; border:1px solid black; background-color:white; margin-left:10%; } </style> <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> <script type="text/javascript"> $(document).on('click','#play',function(){ document.cookie=escape("username=xxx xxx; expires=Thu, 18 Dec 2014 12:00:00 GMT; path=/") alert(document.cookie); }) </script> </head> <body> <div id="play">Display</div> </body> </html>



Reply With Quote

Bookmarks