Hi guys,
I am trying to use the session state in an applicaton. But the problem is that when I try to do
Private Host As String = Session("Server")
I get the following error:
Session state can only be used when enableSessionState is set to true, either
in a configuration file or in the Page directive
So then I changed the session region of my web.config from:
<sessionState
&nbs p; mode="InProc"
&nbs p; stateConnectionString="tcpip=127.0.0.1:42424"
&nbs p;
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
&nbs p; cookieless="true"
&nbs p; timeout="20"
/>
To:
<sessionState
enableSessionState="true"
&nbs p; mode="InProc"
&nbs p; stateConnectionString="tcpip=127.0.0.1:42424"
&nbs p;
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
&nbs p; cookieless="true"
&nbs p; timeout="20"
/>
But then I get the following error:
Configuration Error
Description:
An error occurred during the processing of a configuration file required to
service this request. Please review the specific error details below and modify
your configuration file appropriately.
Parser Error Message:
Unrecognized attribute 'enableSessionState'.
Source Error:
Line 70: To disable cookies, set sessionState cookieless="true". Line 71: --> Line 72: <sessionState Line 73: enableSessionState="true" Line 74: mode="InProc" |
Can anyone shine some light on the subject? Thanks, Mart.