title: ASP.NET MVC Session vs Global vs Cache
body: <p>I have an application that was written in vanilla ASP.NET that I would like to port over to ASP.NET MVC.</p>
  
  <p>I, however, am confused about the right place to persist objects.  I need to persist for a couple reasons:</p>
  
  <ol>
  <li>I would like all to have a <strong>single</strong> database connection, wrapped in a "repository" or "manager" style object.</li>
  <li>Each user has a user object that needs to be saved on a per-session basis.</li>
  </ol>
  
  <p>Normally, I would say that #1 would be saved as a static item in the Globals.asax that can be hit using <code>Global.Repository</code> or similar.</p>
  
  <p>And I would normally say that #2 should be a property with a session backing store somewhere in the base class of the pages.</p>
  
  <p>Now the reason I am confused is that I have heard that sessions have changed in MVC, and the Global.asax no longer holds the same class.  Also, the concept of pages has been removed, so adding a property to the base class of a controller seems... wrong.</p>
  
  <p>What say yall?</p>