private void Page_Load(object sender, System.EventArgs e) { // (1) Check if browser accepts cookies. if (Request.Browser.Cookies) { // (2) If the cookie does not exist... if (Request.Cookies["LastVisit"] == null) { // (3) Create cookie. HttpCookie cookLastVisit = new HttpCookie("LastVisit", DateTime.Now.ToString()); // (4) Set the expiration to tommorrow. cookLastVisit.Expires = DateTime.Now.AddDays(1); // (5) Add to cookies collection. Response.Cookies.Add(cookLastVisit); // Display message. Response.Write("This is your first visit."); } else { // Get the cookie. HttpCookie cookLastVisit = Request.Cookies["LastVisit1"]; // Display a message showing time of last visit. Response.Write("You last visited this page: " + cookLastVisit.Value); // Update the cookie on the client. Response.Cookies["LastVisit"].Value = DateTime.Now.ToString(); Response.Cookies["LastVisit"].Expires = DateTime.Now.AddDays(1); } } else { Response.Write("Your browser does not accept cookies."); } }>Using ASP.Net and C#, how do you get and set cookie values in a ASP.Net Webform?