title: How do I implement session aware WEB API on specific controllers?
body: <p>I am creating some WEB API 2 controllers that are needing to be session aware. I have previous done this by adding </p>
  
  <pre><code>/// &lt;summary&gt;
  /// Application_s the post authorize request.
  /// &lt;/summary&gt;
  protected void Application_PostAuthorizeRequest()
  {
       HttpContext.Current.SetSessionStateBehavior(SessionStateBehavior.Required);
  }
  </code></pre>
  
  <p>However we have API controllers in the solution for other business critical parts of the site that have been highly optimized and are returning responses of around 500ms and if this is turned on it consistently goes up to 2 seconds. These controllers do not need session awareness.</p>
  
  <p>We only need certain controllers given session access, I've read this article <a href="http://www.codeproject.com/Tips/513522/Providing-session-state-in-ASP-NET-WebAPI" rel="nofollow">http://www.codeproject.com/Tips/513522/Providing-session-state-in-ASP-NET-WebAPI</a> and was thinking if it's possible to add a different route with session awareness but there is no <strong>RouteHandler</strong> property when mapping the routes.</p>
  
  <p>Does anyone have any ideas?</p>