I have a situation where I won't know whether or not a cookie value has been set, and I need a way to check this.
In my code behind (test.aspx.cs) I have the following line
Label.Text = Request.Cookies["somecookie"].Value;
This will throw a NullReferenceException if "somecookie" was never set, and from that point on, I can't read any other cookie info.
How can I test whether or not this cookie was set before applying the ".Value" to the cookie object?