Needed help on SessionID in Global.ascx.vb

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mae

    Needed help on SessionID in Global.ascx.vb

    Dear all,

    I'm new to Session.Session ID in Global.asax.vb I wanted to
    use the sessionID in "Application_Au thenticateReque st" to
    check for sessionID for each IE, for testing purposes I
    just put Response.Write( Session.Session ID), 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"
    stateConnection String="tcpip=1 27.0.0.1:42424"
    sqlConnectionSt ring="data source=127.0.0. 1;user
    id=sa;password= "
    cookieless="fal se"
    timeout="20"
    />

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

    How to resolve it ?
    Thanks in advance


    Regards,
    Mae

  • Teemu Keiski

    #2
    Re: Needed help on SessionID in Global.ascx.vb

    Hi,

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

    See this article for the exact sequence of HttpApplication events.



    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist

    "Mae" <anonymous@disc ussions.microso ft.com> wrote in message
    news:096c01c3a8 42$1f588a30$a60 1280a@phx.gbl.. .[color=blue]
    > Dear all,
    >
    > I'm new to Session.Session ID in Global.asax.vb I wanted to
    > use the sessionID in "Application_Au thenticateReque st" to
    > check for sessionID for each IE, for testing purposes I
    > just put Response.Write( Session.Session ID), 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"
    > stateConnection String="tcpip=1 27.0.0.1:42424"
    > sqlConnectionSt ring="data source=127.0.0. 1;user
    > id=sa;password= "
    > cookieless="fal se"
    > timeout="20"
    > />
    >
    > I've try to put the mode="StateServ er", but it still show
    > me the same error.
    >
    > How to resolve it ?
    > Thanks in advance
    >
    >
    > Regards,
    > Mae
    >[/color]


    Comment

    Working...