I get an error when I do the following:
if(Session[\"value\"] != null) { // code }
The error i get is this:
Object reference not
You also can use:
if (Session == null || String.IsNullOrEmpty((string)Session["session_object"])){ // Do something }
I solve by this way:
if (Session.Count > 0 && Session["mySessionVariable"].ToString() != null) { }