Create cookies using MVC 5 controller code-sample ? 1 2 3 4 5 6 7 private static void CreateCookies( string UID) { System.Web.HttpCookie cookie = System.Web.HttpContext.Current.Request.Cookies[ "UIDCookie" ] ?? new System.Web.HttpCookie( "UIDCookie" ); cookie.Values[ "UID" ] = Convert.ToString(UID); System.Web.HttpContext.Current.Response.Cookies.Add(cookie); } private static void CreateCookies(string UID) { System.Web.HttpCookie cookie = System.Web.HttpContext.Current.Request.Cookies["UIDCookie"] ?? new System.Web.HttpCookie("UIDCookie"); cookie.Values["UID"] = Convert.ToString(UID); System.Web.HttpContext.Current.Response.Cookies.Add(cookie); } Read cookies using JavaScript code-sample ? 01 02 03 04 05 06 ...
Angular, React, JavaScript, Java, PHP, SQL, C#, Vue, NodeJs, TypeScript and Interview Questions Answers