Answer: It can be created using this coding.
HttpCookie h=new HttpCookie("userinfo");
h.Value="welcome";
//this line is very important
h.Expires=DateTime.MaxValue;
Response.Cookies.Add(h);
//Write this code in a suitable event handler
//eg: Button1_Click
Asked In: Many Interviews |
Alert Moderator