title: ASP.Net MVC: How do you access the session from a different project within the solution?
body: <p>I have 2 projects in my solution. </p>
  
  <ol>
  <li>MVC Web application</li>
  <li><p>Class library</p>
  
  <ul>
  <li>The MVC Web application references the class library. </li>
  <li>The class library contains a class that extends the default ASP.Net Controller.</li>
  </ul></li>
  </ol>
  
  <p>I'm putting a variable in session in the application's Global.asax.</p>
  
  <pre><code>protected void Session_Start(object sender, EventArgs args)
  {
     HttpContext.Current.Session["DomainName"] = Request.Url.Host;
  }
  </code></pre>
  
  <p>In the class library I'm trying to get the value from the HttpContext.Session, but HttpContext.Session keeps coming up null. </p>
  
  <pre><code>public class MyController : System.Web.Mvc.Controller
  {
      public MyController () : base()
      {
          //HttpContext.Session is always null at this point
          ViewData["DomainName"] = HttpContext.Session["DomainName"];
      } 
  }
  </code></pre>
  
  <p>HttpContext.<strong>Current</strong>.Session doesn't seem to be an option in controllers. Any ideas?</p>