473,770 Members | 6,133 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 11391
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***@dcdconsu ltants.com> wrote in message
news:%2******** *******@tk2msft ngp13.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&Post ID=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
10804
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; Application.Lock();
5
2806
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 interacting with my site. Anyone have any insight? Thanks in advance
4
11963
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 that prevents this from happening? I've never gotten Session_End to fire either. -M
1
1710
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 put this in the Session_End procedure of the global.asax.vb file. The problem is that nothing seems to happen. So either the Session_End is not firing or there is some issue with using the sqlclient at this time?
2
4733
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. I have timeout set to 1 min I have a variable in session_start that is incremented each new session, and it is then decremented in Session_End. I use this variable on a web form to show current users online. All of this works just fine, so I...
0
1693
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. When the login is successful login page writes back javascript
5
3463
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 (navigates somewhere else or closes the browser).
11
2827
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 Abandon. I need the event to fire at Session timeout in order to capture and store the Datetime this occurs. However in the application I am writing, I have been unable discern any indication that the event is firing. I have used break...
7
9281
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 know if users have closed down their browsers without logging off first. However, although the code seems to run OK on our development servers (WinXP ASP.NET v. 1.1, SQL Server 2000, IIS6), they don't seem to be firing on the live server despite...
0
9592
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10059
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10005
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9871
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8887
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7416
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5452
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3972
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.