title: Enable session state
body: <p>I'm using C# asp.net. I have deployed my site to Sharepoint 2010 and after deployment I get an error that says enable session state. I managed to solve this error by adding the following code to web.config file:</p>
  
  <pre><code>    &lt;system.webServer&gt;
      &lt;modules runAllManagedModulesForAllRequests="true"&gt;
          &lt;remove name="Session" /&gt;
          &lt;add name="Session" type="System.Web.SessionState.SessionStateModule, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /&gt;
      &lt;/modules&gt;
  &lt;/system.webServer&gt;
  </code></pre>
  
  <p>and I added this to the page directive: </p>
  
  <pre><code>enableSessionState="true"
  </code></pre>
  
  <p>Is there a way to add it in the master page? 
  I tried adding <code>enableSessionState="true"</code> but I get this error: <code>Error 10  Error parsing attribute 'enablesessionstate': Type 'System.Web.UI.MasterPage' does not have a public property named 'enablesessionstate'</code> 
  am I doing it wrong? if so, what is the correct way to enable session state in master page?</p>