title: How to Set and Retrieve Session in ASP.NET MVC 5?
body: <p>I am working on an ASP.NET MVC 5 application and I am having problem storing data to session. The value I get is always null.</p>
  
  <p>Here is where I set the session:</p>
  
  <pre><code>string mail = user.Email;
  string response = user.CheckEmail();
  Session["email"] = mail;
  </code></pre>
  
  <p>I am testing the session here, It is redirecting to YYY:</p>
  
  <pre><code>if ((string)Session["mail"] != null)
  {
      return RedirectToAction("PPP");
  }
  else
  {
      return RedirectToAction("YYY");
  }
  </code></pre>
  
  <p>Please immediate help will be appreciated. Thanks</p>