473,411 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

Session_End Not Firing

Hey guys I have a user tracking setup to track users. What it does is once a
user hits my site it sends me an email telling me some info and once a user
clicks the logout button it sends a second email that tells me what pages
the visited, how long they were on each page, etc. The second email is in
the Session_End Sub and the first is in the Session_Start. Now my question
is Why is it that the Session_End is never fired. I was forced to put the
code to send the second email on the logout.aspx page so when they click
logout then it sends it; THAT WORKS. But what happends when a user just
closes the browser window or goes to another site wihtout clicking logout.
Can someone tell me how I would fix this or why the Session_End is not being
fired at ALL. Thanks
Nov 17 '05 #1
2 11365
Session_End is not a very reliable place to put this kind of code. In Logout
page you can call Sessiob.Abandon. Then you will get the event. But if user
simply logs out, you will never get the event untill Session times out. The
approach you have right now, i.e. sending when LogOut button is clciked is
the only and recommended way to get it done.

--
Naveen K Kohli
http://www.netomatix.com
"Chris Sibel" <ch***@dcdconsultants.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Hey guys I have a user tracking setup to track users. What it does is once a user hits my site it sends me an email telling me some info and once a user clicks the logout button it sends a second email that tells me what pages
the visited, how long they were on each page, etc. The second email is in
the Session_End Sub and the first is in the Session_Start. Now my question
is Why is it that the Session_End is never fired. I was forced to put the
code to send the second email on the logout.aspx page so when they click
logout then it sends it; THAT WORKS. But what happends when a user just
closes the browser window or goes to another site wihtout clicking logout.
Can someone tell me how I would fix this or why the Session_End is not being fired at ALL. Thanks

Nov 17 '05 #2
The session will time out after 20 minutes of no page
requests from the
user.
This default time interval is configurable in your
web.config file.
After the session times out the Session_End event will be
called in your
Global.asax file.
You can terminate the session manually by calling
Session.Abandon, but be
aware this will cause the Session_End event to not be
called. But that's
not so bad. Just take your code from the Session_End
event, put it in a
separate function, then call that function from both your
Session_End event
and whenever you call Session.Abandon.

Here's more details for you:
http://www.asp.net/Forums/ShowPost.aspx?
tabindex=1&PostID=7504

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net

-----Original Message-----
Hey guys I have a user tracking setup to track users. What it does is once auser hits my site it sends me an email telling me some info and once a userclicks the logout button it sends a second email that tells me what pagesthe visited, how long they were on each page, etc. The second email is inthe Session_End Sub and the first is in the Session_Start. Now my questionis Why is it that the Session_End is never fired. I was forced to put thecode to send the second email on the logout.aspx page so when they clicklogout then it sends it; THAT WORKS. But what happends when a user justcloses the browser window or goes to another site wihtout clicking logout.Can someone tell me how I would fix this or why the Session_End is not beingfired at ALL. Thanks
.

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Kenn Ghannon | last post by:
I've got an ASP.NET page with a counter subtraction routine in the Session_End method in the Global.asax.cs: protected void Session_End(Object sender, EventArgs e) { ulong curUsers; ...
5
by: Steve M | last post by:
Why are my sessions lasting so long? I have them set to 20 minute timeout in config file? The Session_End event is getting called an hour or more sometimes--well after the user has stopped...
4
by: Max | last post by:
I've noticed some procedures don't run in the global.asax when you'd expect them to. I've rebuilt and set break points, but Application_Start just isn't firing today. Is there some configuration...
1
by: Stig Johansen | last post by:
I have what I thought was a simple task. When the user's session times out I want to save some data to a database so that these can be retrieved the next time the user connects. I have therefore...
2
by: Bela | last post by:
Hello I was wondering if someone could help me out with a Session_End problem in my Global.asax. I've tried everything, and still no success Here is the scenario: sessionstate is set to InProc....
0
by: Ram | last post by:
I have a start page for my application default.htm which contains four frames. header.htm login.aspx rightside.htm footer.htm login.aspx conatins username, password fields and login button....
5
by: JezB | last post by:
Why is my Session_End event in global.asax never firing ? I've tried fiddling with the timeouts but still nothing. Ideally I want to do some processing whenever someone leaves my web application...
11
by: OldProgrammer | last post by:
All the documentation and discussion I have read indicate that the Session_End is not supposed to fire unless you are in "inProc" Session state mode, and then only on Session Timeout or at Session...
7
by: Bruno | last post by:
We are attempting to automatically log users off from the Session_End event in global.asax and set some values on session_start. It is not a critical task, more of a housekeeping task so that we...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.