Needed help on SessionID in Global.ascx.vb

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
 
T

Teemu Keiski

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top