title: Cannot use the Session variable
body: <p>after many research in Google, i didn't found the solution to my problem.</p>
  
  <p>When i want to make enter value to the Session variable, all is ok :</p>
  
  <pre><code>Session["idResult"] = youthID;
  </code></pre>
  
  <p>but when i want to get the value with the line code :</p>
  
  <pre><code>youthID = (int)Session["idResult"];
  </code></pre>
  
  <p>i get the error :
  <em>Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <code>&lt;configuration&gt;\&lt;system.web&gt;\&lt;httpModules&gt;</code> section in the application configuration.</em></p>
  
  <p>i tried to add in the web.config : 
   <em>EnableSessionState="True"</em></p>
  
  <p>and also :</p>
  
  <pre><code>&lt;httpModules&gt;&lt;add name="Session" type="System.Web.SessionState.SessionStateModule"/&gt;     &lt;/httpModules&gt;
  &lt;pages enableSessionState="true"/&gt;  
  </code></pre>
  
  <p>and many other possibilities but it's doesn't work</p>
  
  <p>my default web.config is :</p>
  
  <pre><code>&gt; &lt;?xml version="1.0"?&gt; &lt;!--   For more information on how to configure
  &gt; your ASP.NET application, please visit  
  &gt; http://go.microsoft.com/fwlink/?LinkId=169433   --&gt; &lt;configuration&gt;  
  &gt; &lt;system.web&gt;
  &gt;     &lt;compilation debug="true" targetFramework="4.5"/&gt;
  &gt;     &lt;httpRuntime targetFramework="4.5"/&gt;   &lt;/system.web&gt; &lt;/configuration&gt;
  </code></pre>