mukesh1
on Feb 26, 2018 04:13 AM
1864 Views
Want to add id of user in cookies when user first login, and cookies will remove after 320 days.
Mainly i am working in mvc using entity framework with database first approach.
Download FREE API for Word, Excel and PDF in ASP.Net:
Download
HttpCookie myCookie = new HttpCookie("ID");
myCookie["ID"] = Aunthicate.ID.ToString();
//myCookie.Expires = DateTime.Now.AddDays(-1d);
System.Web.HttpContext.Current.Response.Cookies.Add(myCookie);
and for get cookies value in session
Session["ID"] = Server.HtmlEncode(Request.Cookies["ID"].Value);