Is there any difference in using the following
Request.Cookies["Key"].Value
and
Request.Cookies["Key"].ToString()
Is there any difference in using the following
Request.Cookies["Key"].Value
and
Request.Cookies["Key"].ToString()
Yes, running the following block of code demonstrates the different outputs:
Request.Cookies.Add(new HttpCookie("Test", "MyValue"));
Debug.Print(Request.Cookies["Test"].Value);
Debug.Print(Request.Cookies["Test"].ToString());
The first debug print will display "MyValue" whereas the second will display "System.Web.HttpCookie".