title: Authentication with session when using Hangfire dashboard
body: <p>I'd like to use the Session property (Session["isAdmin"]) to determine whether or not a user should be able to view the Hangfire Dashboard.</p>
  
  <p>The problem is that when i'm using</p>
  
  <pre><code>HttpContext.Current.Session
  </code></pre>
  
  <p>this is null - eventhough i'm using this property on my other pages where is has data in it.
  <br>
  I'm struggling in following code snippet. <br>I want to let the admin role view the page.</p>
  
  <pre><code>public class AuthorizationFilter : IDashboardAuthorizationFilter
      {
          public bool Authorize(DashboardContext context)
          {
              var session = HttpContext.Current.Session;
  
              if (session == null || 
                  session["username"] == null ||
                  FindUserRole(session["username"].ToString()) != 
                   "ADMIN")
              {
                  return false;
              }
              return true;
          }
      }
  </code></pre>
  
  <p>Are there any other way I can do this easier?</p>