I am using ASP.NET and C#.
I must read a cookie called "TheCookie".............
TheCookie have about 3 values in them. Cookie1, Cookie2 and Cookie3.
How would i get the value in code to read Cookie2's value inside "TheCookie"?
This is how i would read when a cookie only have 1 value, but i dont know what to do when there are multiple vales in the cookie.......... Code for VB.NET
Dim userCookie As HttpCookie
userCookie = Request.Cookies("UserEmail")
Thanks in advance!
You set them via
(C#)
Response.Cookies["TheCookie"]["Cookie1"] = "Hello World";
(VB)
Response.Cookies("TheCookie")("Cookie1") = "Hello World"
and read them like so
(C#)
string myValue = Request.Cookies["TheCookie"]["Cookie1"];
(VB)
Dim myValue As String
myValue = Request.Cookies("TheCookie")("Cookie1")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With