How to handle multi value cookies in ASP.NET Core?
11
In the full .NET framework we have support for multi value cookies. e.g. a cookie could have multiple values:
HttpCookie aCookie = new HttpCookie("userInfo");
aCookie.Values["userName"] = "patrick";
aCookie.Values["lastVisit"] = DateTime.Now.ToString();
See also the docs about HttpCookie.Values on MSDN and ASP.NET Cookies Overview on MSDN.
With ASP.NET Core, the multi value cookie seems to be gone. There is no HttpCookie.Values and HttpRequest.Cookies returns a IRequestCookieCollection which is like a dictionary from string to string
How should I now create and read multi value cookies in ASP.NET Core? How could I read the multi value cookies created in Full ASP.NET and read them in ASP.NET Core?