asp.net mvc 5 create a collection of cookies

0

How can I create and recover a collection of cookies based on the same name of cookie or with different names?

What I want to get to have would be something like this:

httpCookie.Domain = "localhost";
httpCookie.Expires = DateTime.Now.AddMinutes(15);
httpCookie.Values = Convert.ToBase64String(MachineKey.Protect(System.Text.Encoding.UTF8.GetBytes(model.Token)));
httpCookie.Values = Convert.ToBase64String(MachineKey.Protect(System.Text.Encoding.UTF8.GetBytes(model.id)));
httpCookie.HttpOnly = true;
httpCookie.Secure = true;
HttpContext.Current.Response.Cookies.Add(httpCookie);
    
asked by vcasas 09.05.2018 в 20:50
source

0 answers