title: Saving to session in Global.asax
body: <p>When a user encounters a specific type of error, on Global.asax we update the session variable IsErrorEncountered, save the session and redirect the users back to the Dashboard page. On the Dashboard page, when I try to access this session variable it does not reflect the changes I've made in Global.asax. Why is the session not being saved? Can someone please tell me if I can even update my session from Global.asax?</p>
  
  <pre><code>Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
  
     Dim session As SessionData = HttpContext.Current.Session("SessionData")
     sessionData.IsErrorEncountered = True
     HttpContext.Current.Session.Add("SessionData", session)
  
     HttpContext.Current.Response.Redirect("~/Dashboard/Index")
  
  End Sub
  </code></pre>