Needed help on SessionID in Global.ascx.vb

  • Thread starter Thread starter Mae
  • Start date Start date
M

Mae

Dear all,

I'm new to Session.SessionID in Global.asax.vb I wanted to
use the sessionID in "Application_AuthenticateRequest" to
check for sessionID for each IE, for testing purposes I
just put Response.Write(Session.SessionID), but it shows
error message "Session state is not available in this
context" after executing the page.

In Web.Config I put the sesionState tag as below

<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;user
id=sa;password="
cookieless="false"
timeout="20"
/>

I've try to put the mode="StateServer", but it still show
me the same error.

How to resolve it ?
Thanks in advance


Regards,
Mae
 
Hi,

as the error states session is not yet available at that time during the
request. Session becomes available after AcquireRequestStat event is raised
by the HttpApplication i.e in global.asax on
Application_AcquireRequestState.

See this article for the exact sequence of HttpApplication events.

http://www.eggheadcafe.com/articles/20030211.asp
 
Back
Top