Skip to content

Instantly share code, notes, and snippets.

@samueleresca
Created December 3, 2015 21:29
Show Gist options
  • Save samueleresca/c376759898a960ee3947 to your computer and use it in GitHub Desktop.
Save samueleresca/c376759898a960ee3947 to your computer and use it in GitHub Desktop.
//Controllo se il cookie esiste, e lo visualizzo
if(Request.Cookies["ultimaVisita"] != null){
Label1.Text=Server.HtmlEncode(Request.Cookies["ultimaVisita"].Value);
}else{
Label1.Text="No valore";
}
//Setto il valore del cookie per la prossima visita
Response.Cookies["ultimaVisita"].Value=DateTime.Now.ToString();
Response.Cookies["ultimaVisita"].Expires=DateTime.Now.AddDays(1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment