I'm using below code within MVC controller class. My question is: when I attempt to run the code, I get the following error.
NullReferenceException
Code:
if (Session["User"] != null)
{
return true;
}
What am I wrong? What is the problem misunderstood related with session?
Cheers,