title: 'Session state is not available in this context.' from HttpApplication().Session call
body: <p>I'm attempting to build a multi-step registration form and have a session to contain data throughout the process. When my application first loads it attempts set a session variable for use. However, I get the following error message when my application first loads:</p>
  
  <p>Exception details: </p>
  
  <pre><code>System.Web.HttpException: Session state is not available in this context.
  </code></pre>
  
  <p>Source Error:</p>
  
  <pre><code>HttpSessionState session = new HttpApplication().Session;
  </code></pre>
  
  <p>My controller action is as follows: </p>
  
  <pre><code>public class RegistrationController : Controller
  {
      // GET: Registration
      [HttpGet]
      public ActionResult Index()
      {
          HttpSessionState session = new HttpApplication().Session;
  
          CustomerStatusModel model = new CustomerStatusModel();
          model.CustomerStatusId = session["CustomerStatusId"];
  
          return View(model);
      }
  }
  </code></pre>
  
  <p>I'm new to MVC 5 and also new to posting on StackOverflow. I could not find any similar posts. Any advice is much appreciated.</p>