I want to add some things to the cookie in ASP.net MVC.
What is best to handle all things in a cookie or more cookies.
Any good way to handle cookies in asp.net mvc?
Here is an example:
public class HomeController : Controller { public ActionResult CreateCookie() { var cookie = new HttpCookie("cookie_name", "some value"); Response.AppendCookie(cookie); return View(); } public ActionResult ReadCookie() { var cookie = Request.Cookies["cookie_name"]; if (cookie != null) { string value = cookie.Value; } return View(); } }
I found this may be useful
http://stephenwalther.com/blog/archive/2008/07/08/asp-net-mvc-tip-15-pass-browser-cookies-and-server-variables-as-action-parameters.aspx
Source: https://habr.com/ru/post/1314302/More articles:Changing SQL Server Database Version - sql-serverHow to start rdlc using encoding - c #Easy to use Excel data in SQL Server - xmlUsing openrowset to read excel file in temp table; How can I refer to this table? - sql-serverWhich of the best search engine search techniques is phpDetect and analyze embedded video in html? - html-parsingPDF and Excel data scraper - excelTrack Ajax requests on a page - javascriptJava spectrograms: mp3 and microphone - javaIs there an equivalent maven rpm --whatprovides for a jar file? - javaAll Articles