Cookies
Introduction
Cookies are little text files that your browser creates on your hard drive to store different informations inside...
There are usually in the folder C:\WINDOWS\COOKIES\ or, if you have several Windows desks, in the folder C:\WINDOWS\PROFILES\...\COOKIES\... (for Internet Explorer)

Code to create and manage Cookies
<SCRIPT language="JavaScript">
  function cre_cook0(nom,contenu) {
    document.cookie = nom + "=" + escape(contenu)
  }
  function cre_cook(nom,contenu,jours) {
    var expireDate = new Date();
    expireDate.setTime(expireDate.getTime() + jours*24*3600*1000);
    document.cookie = nom + "=" + escape(contenu)
      + ";expires=" + expireDate.toGMTString();
  }
  function lit_cook(nom) {
    var deb,fin
    deb = document.cookie.indexOf(nom + "=")
    if (deb >= 0) {
      deb += nom.length + 1
      fin = document.cookie.indexOf(";",deb)
      if (fin < 0) fin = document.cookie.length
      return unescape(document.cookie.substring(deb,fin))
    }
    return ""
  }
  function tue_cook(nom) { cre_cook(nom,"",-1) }
  function askCook(nom) {
    c=prompt("Mettre dans le cookie :","")
    cre_cook0(nom,c)
  }
  function litCook(nom) {
    c=lit_cook(nom)
    if(c=="") alert("Le cookie est vide !")
    else alert("Le cookie vaut : "+c)
  }
</SCRIPT>
<FORM>
  <TABLE><TR>
    <TD><INPUT onclick=askCook('test') type=button value="Creer le cookie"></TD>
    <TD><INPUT onclick=litCook('test') type=button value="Lire le cookie"></TD>
    <TD><INPUT onclick="tue_cook('test')" type=button value="Effacer le cookie"></TD>
  </TR></TABLE>
</FORM>

Now you can try it :

 [Menu]
Last Update
10/12/2018
32718 visitors
850589 robots
since 01/01/2003
Page generated
in 0.54 second
💗 2003-2018 by S. MARLIERE. Copying is an act of love. Love is not subject to law. Please copy and share.