title: How should I check if a user is authenticated in MVC5?
body: <p>I have seen the following two accessible booleans:</p>
  
  <ul>
  <li><code>System.Web.Mvc.Controller.User.Identity.IsAuthenticated</code></li>
  <li><code>System.Web.Mvc.Controller.Request.IsAuthenticated</code></li>
  </ul>
  
  <p>Is there a difference between these. They both seem to do the same thing so I am not sure which to use.</p>
  
  <p>What I would like to do is:</p>
  
  <pre><code>@if (User.Identity.IsAuthenticated) {
    if (User.IsInRole("Admin")) {
      @Html.ActionLink("Admin", "AdminController")        
    }
  }
  </code></pre>
  
  <p>or </p>
  
  <pre><code>@if (Request.IsAuthenticated) {
    if (User.IsInRole("Admin")) {
      @Html.ActionLink("Admin", "AdminController")        
    }
  }
  </code></pre>
  
  <p>Would either of the above work equally well ?</p>