ASP.NET + C# HttpContext.Current.Session is null (Inside WebService)

вот как я инициирую сессию

 protected void Session_Start(object sender, EventArgs e)
    {
        HttpContext.Current.Session["CustomSessionId"] = Guid.NewGuid();
    }

в моем решении под библиотекой классов я пытаюсь получить доступ к ней и получаю исключение null:

string sess = HttpContext.Current.Session["CustomSessionId"] ;

вот мой конфиг в web.config и app.config (в моей библиотеке)

    <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
  </system.serviceModel>
  <system.web>
      <pages enableSessionState = "true" />
      <httpModules>
        <add type="System.Web.SessionState.SessionStateModule" name="Session"/>
      </httpModules>
      <compilation debug="true" targetFramework="4.0" />
    </system.web>

(app. config)

12
задан SexyMF 25 September 2011 в 13:13
поделиться