my session_onend is not working

Discussion in 'ASP .Net' started by anand, Jul 9, 2003.

  1. anand

    anand Guest

    In my website i want to trace the event when user log off
    from the site by closing the explorer so i am unable to
    run any server side program at that time and my
    session_onend event also not working can any one tell me
    why the session_onend is not working.
    Thanx in advance
    anand, Jul 9, 2003
    #1
    1. Advertising

  2. anand

    Kenn Ghannon Guest

    Well...can you post the code you're using? That might help....

    The Session_End will only NOT fire (as I found out the hard way) if:
    1) There is an error in that section of code (it quietly exits instead of
    raising error messages)
    2) Nothing is stored in the Session
    3) You are not using 'InProc' in your sessionstate (in the web.config file).

    If you're using Visual Studio, you can set a breakpoint on that section of
    code and debug your app -- make sure that your session timeout value (also
    in your web.config file) is set to some ridiculously low number (like 1 for
    1 minute versus the 20 for 20 minutes that it defaults to)...


    "anand" <> wrote in message
    news:13b701c3461d$ba0a02c0$...
    > In my website i want to trace the event when user log off
    > from the site by closing the explorer so i am unable to
    > run any server side program at that time and my
    > session_onend event also not working can any one tell me
    > why the session_onend is not working.
    > Thanx in advance
    >
    Kenn Ghannon, Jul 10, 2003
    #2
    1. Advertising

  3. anand

    anand Guest

    Thanx for your reply
    1]I have only one expression in my session_onend event
    server.execute("page.aspx")
    2] i have sesion variable
    3] i am using Inproc

    now the problem is if user log off from site by lcosing
    the browser window the session_onend event doesn't work.
    its working if i execute session.abondan or somthing like
    that but it doesn't execute say after automatically after
    20 min when user close down the browser
    I hope you you understand what i am trying to do.
    i just want to track down the user
    if it is conncted to site i want to show him online other
    wise offline
    but if user close down the browser .......
    can u help in that

    >-----Original Message-----
    >Well...can you post the code you're using? That might

    help....
    >
    >The Session_End will only NOT fire (as I found out the

    hard way) if:
    >1) There is an error in that section of code (it quietly

    exits instead of
    >raising error messages)
    >2) Nothing is stored in the Session
    >3) You are not using 'InProc' in your sessionstate (in

    the web.config file).
    >
    >If you're using Visual Studio, you can set a breakpoint

    on that section of
    >code and debug your app -- make sure that your session

    timeout value (also
    >in your web.config file) is set to some ridiculously low

    number (like 1 for
    >1 minute versus the 20 for 20 minutes that it defaults

    to)...
    >
    >
    >"anand" <> wrote in message
    >news:13b701c3461d$ba0a02c0$...
    >> In my website i want to trace the event when user log

    off
    >> from the site by closing the explorer so i am unable to
    >> run any server side program at that time and my
    >> session_onend event also not working can any one tell me
    >> why the session_onend is not working.
    >> Thanx in advance
    >>

    >
    >
    >.
    >
    anand, Jul 10, 2003
    #3
  4. anand

    Chris Becker Guest

    I think your problem is with #1 below. Server.Execute executes another
    page, but the execute of that page expects there to be valid request and
    response objects, which when you hit Session_OnEnd, are not created. You
    need to create a class that does the code in "Page.aspx" but doesn't try to
    return anything to the httpcontext.current.response or get anything from
    httpcontext.current.request.

    "anand" <> wrote in message
    news:07f701c346b4$2c4060a0$...
    > Thanx for your reply
    > 1]I have only one expression in my session_onend event
    > server.execute("page.aspx")
    > 2] i have sesion variable
    > 3] i am using Inproc
    >
    > now the problem is if user log off from site by lcosing
    > the browser window the session_onend event doesn't work.
    > its working if i execute session.abondan or somthing like
    > that but it doesn't execute say after automatically after
    > 20 min when user close down the browser
    > I hope you you understand what i am trying to do.
    > i just want to track down the user
    > if it is conncted to site i want to show him online other
    > wise offline
    > but if user close down the browser .......
    > can u help in that
    >
    > >-----Original Message-----
    > >Well...can you post the code you're using? That might

    > help....
    > >
    > >The Session_End will only NOT fire (as I found out the

    > hard way) if:
    > >1) There is an error in that section of code (it quietly

    > exits instead of
    > >raising error messages)
    > >2) Nothing is stored in the Session
    > >3) You are not using 'InProc' in your sessionstate (in

    > the web.config file).
    > >
    > >If you're using Visual Studio, you can set a breakpoint

    > on that section of
    > >code and debug your app -- make sure that your session

    > timeout value (also
    > >in your web.config file) is set to some ridiculously low

    > number (like 1 for
    > >1 minute versus the 20 for 20 minutes that it defaults

    > to)...
    > >
    > >
    > >"anand" <> wrote in message
    > >news:13b701c3461d$ba0a02c0$...
    > >> In my website i want to trace the event when user log

    > off
    > >> from the site by closing the explorer so i am unable to
    > >> run any server side program at that time and my
    > >> session_onend event also not working can any one tell me
    > >> why the session_onend is not working.
    > >> Thanx in advance
    > >>

    > >
    > >
    > >.
    > >
    Chris Becker, Jul 21, 2003
    #4
  5. anand

    Ram Guest

    Anand,
    I am just trying to understand your problem. Are you expecting the
    Sesion_onEnd to fire immediately after the user closed his browser
    window?

    Web server will not know even if the user closed his browser window
    and only the default time out will occur(20 minutes or your timeout
    value). If you want to notify the web server immediately when the user
    closes his window, you can launch a popup window in the unload event
    of the main window and call the session.abandon in the popup window.

    Please let me know if my understanding of your question is wrong.

    "anand" <> wrote in message news:<058701c346de$ae348f30$>...
    > once again i am here
    >
    > i got a link please look at it
    > http://www.codeproject.com/asp/user_logtime.asp?
    > df=100&forumid=2496&select=471196#xx76299xx
    >
    > this give a demonstration how to track the user ./ but i
    > coudn't understand if session will tim out how the program
    > is going to know the session("member") value .
    >
    > can any one help in this
    >
    >
    >
    > >-----Original Message-----
    > >Well...can you post the code you're using? That might

    > help....
    > >
    > >The Session_End will only NOT fire (as I found out the

    > hard way) if:
    > >1) There is an error in that section of code (it quietly

    > exits instead of
    > >raising error messages)
    > >2) Nothing is stored in the Session
    > >3) You are not using 'InProc' in your sessionstate (in

    > the web.config file).
    > >
    > >If you're using Visual Studio, you can set a breakpoint

    > on that section of
    > >code and debug your app -- make sure that your session

    > timeout value (also
    > >in your web.config file) is set to some ridiculously low

    > number (like 1 for
    > >1 minute versus the 20 for 20 minutes that it defaults

    > to)...
    > >
    > >
    > >"anand" <> wrote in message
    > >news:13b701c3461d$ba0a02c0$...
    > >> In my website i want to trace the event when user log

    > off
    > >> from the site by closing the explorer so i am unable to
    > >> run any server side program at that time and my
    > >> session_onend event also not working can any one tell me
    > >> why the session_onend is not working.
    > >> Thanx in advance
    > >>

    > >
    > >
    > >.
    > >
    Ram, Jul 22, 2003
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. steve
    Replies:
    0
    Views:
    417
    steve
    Aug 25, 2003
  2. rob

    session_onend event not firing

    rob, Aug 27, 2003, in forum: ASP .Net
    Replies:
    6
    Views:
    2,337
    Anand
    Aug 28, 2003
  3. Martin

    Session_OnEnd is not being called

    Martin, Dec 29, 2003, in forum: ASP .Net
    Replies:
    6
    Views:
    3,483
    Alvin Bruney
    Dec 30, 2003
  4. Chris  Ashley

    Session_OnEnd not firing sometimes?

    Chris Ashley, Dec 12, 2007, in forum: ASP .Net
    Replies:
    4
    Views:
    503
    Hal Rosser
    Dec 12, 2007
  5. Joel Brabant

    Session_OnEnd not working

    Joel Brabant, Sep 20, 2003, in forum: ASP General
    Replies:
    1
    Views:
    114
    Aaron Bertrand [MVP]
    Sep 20, 2003
Loading...

Share This Page