469,609 Members | 1,082 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

my session_onend is not working

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

Nov 17 '05 #1
4 2426
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" <an*******@yahoo.com> wrote in message
news:13****************************@phx.gbl...
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

Nov 17 '05 #2
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 ofraising 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 ofcode and debug your app -- make sure that your session timeout value (alsoin your web.config file) is set to some ridiculously low number (like 1 for1 minute versus the 20 for 20 minutes that it defaults to)...

"anand" <an*******@yahoo.com> wrote in message
news:13****************************@phx.gbl...
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

.

Nov 17 '05 #3
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" <an*******@yahoo.com> wrote in message
news:07****************************@phx.gbl...
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" <an*******@yahoo.com> wrote in message
news:13****************************@phx.gbl...
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

.

Nov 17 '05 #4
Ram
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" <an*******@yahoo.com> wrote in message news:<05****************************@phx.gbl>...
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" <an*******@yahoo.com> wrote in message
news:13****************************@phx.gbl...
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

.

Nov 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Joel Brabant | last post: by
3 posts views Thread by cab | last post: by
4 posts views Thread by Propin | last post: by
4 posts views Thread by Renjith | last post: by
1 post views Thread by Andy Kasotia | last post: by
11 posts views Thread by David Thielen | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.