// Check if cookie exists, and display it if it does
if (Request.Cookies["lastVisit"] != null)
// Encode the cookie in case the cookie contains client-side script
Label1.Text = Server.HtmlEncode(Request.Cookies["lastVisit"].Value);
else Label1.Text = "No value defined";
// Define the cookie for the next visit
Response.Cookies["lastVisit"].Value = DateTime.Now.ToString();
Response.Cookies["lastVisit"].Expires = DateTime.Now.AddDays(1);
Great Article
ReplyDeleteASP.NET Online Training | C# Online Training
ASP.NET Training In Chennai | C# Training in Chennai