A Cookie Test Program : Cookie « Development « JavaScript DHTML






A Cookie Test Program

  
<HTML>
<HEAD>
<TITLE>Cookie Test</TITLE>
<SCRIPT LANGUAGE="JavaScript"><!--
function updateCookie() {
 document.cookie=document.form1.cookie.value
 location.reload(true)
}
// --></SCRIPT>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
 document.write("Your current cookie value is: '"+ document.cookie+"'")
</SCRIPT>
<FORM ACTION="" NAME="form1">
<P>Enter new cookie: <INPUT TYPE="TEXT" SIZE="60" NAME="cookie"></P>
<INPUT TYPE="BUTTON" NAME="setCookie" VALUE="Set Cookie" onClick="updateCookie()">
</FORM>
</BODY>
</HTML>



           
         
    
  








Related examples in the same category

1.Reads, writes and deletes current Web page's cookies
2.'cookieEnabled' Example
3.Create a cookie
4.Set the cookie expire date
5.Secure cookie
6.Read all cookies
7.Standard cookie functions: extract Cookie Value
8.Save name to cookie
9.Cookie set, delete, get value and create
10.Cookie utility function
11.Cookie install and delete (remove)
12.Cookie: retrieve a future expiration date in proper format
13.A Cookie Example
14.Quiz Program base on Cookie
15. A Website Access Counter
16. Keeping Track of User Access Time
17.Bill Dortch's Cookie Functions
18.Cookie Preferences
19.Set cookie to document and read it back