title: How do I persist logged in user in MVC?
body: <p>I'm setting up my first MVC site and I just implemented a security controller and views.</p>
  
  <p>However what I don't understand is how I can persist the logged in user data across my controllers.</p>
  
  <p>For example the user logs in with email/password.  I can then verify that the email and passwords match and I do the following:</p>
  
  <pre><code>FormsAuthentication.SetAuthCookie(userLogin.UserName, false);
  return View("../Home/Index");
  </code></pre>
  
  <p>Now say for example I want in the Index view to present data that only a user can see.</p>
  
  <p>I have a table setup but it's based on the user_id.</p>
  
  <p>Can I either save the user_id when they login or is there something already available to me to access their email(user)? (I could then look up the id via the email if necessary)</p>
  
  <p>My MVC is setup for Forms authentication:</p>
  
  <pre><code>&lt;authentication mode="Forms"&gt;
    &lt;forms loginUrl="~/Security/Login" timeout="2880" /&gt;
  &lt;/authentication&gt;
  </code></pre>
  
  <p>and I decorated the controllers with the "[Authorize]" annotation.</p>