473,626 Members | 3,093 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Session_End never firing

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).
Nov 18 '05 #1
5 3459
Session_End does not fire when someone navigates elsewhere or closes the
browser. It fires when the idle timeout is reached, so you cannot do
redirects or anything with the response, if this is how you are testing
session_end firing. Try putting in a breakpoint.

"JezB" <je***********@ blueyonder.co.u k> wrote in message
news:e6******** ********@TK2MSF TNGP11.phx.gbl. ..
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).

Nov 18 '05 #2
Ah I see. So it's not really the opposite of Session_Start ...
Is there any reliable way to capture when a user leaves my site ? I'm trying
to audit session activity.

"Marina" <so*****@nospam .com> wrote in message
news:uQ******** ******@TK2MSFTN GP11.phx.gbl...
Session_End does not fire when someone navigates elsewhere or closes the
browser. It fires when the idle timeout is reached, so you cannot do
redirects or anything with the response, if this is how you are testing
session_end firing. Try putting in a breakpoint.

"JezB" <je***********@ blueyonder.co.u k> wrote in message
news:e6******** ********@TK2MSF TNGP11.phx.gbl. ..
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).


Nov 18 '05 #3
There is really no reliable way to do anything when the user shuts their
browser window for example.

You could in theory try to capture the event in the onunload event on the
client and make some sort of call to the server to say the the user is
leaving the site. One of the issues with this, is that onunload fires
whenever the pages is unloaded - so for navigating elsewhere to your site,
or just doing a postback. So you would need to keep track of whether or not
the user just did something but stayed within your site, or is actually
leaving, which is tricky.

But overall, there is no easy way to do this, so you would just wait till
the idle timeout is reached (or the user manually logs out) to do your
cleanup.
"JezB" <je***********@ blueyonder.co.u k> wrote in message
news:e%******** ********@tk2msf tngp13.phx.gbl. ..
Ah I see. So it's not really the opposite of Session_Start ...
Is there any reliable way to capture when a user leaves my site ? I'm trying to audit session activity.

"Marina" <so*****@nospam .com> wrote in message
news:uQ******** ******@TK2MSFTN GP11.phx.gbl...
Session_End does not fire when someone navigates elsewhere or closes the
browser. It fires when the idle timeout is reached, so you cannot do
redirects or anything with the response, if this is how you are testing
session_end firing. Try putting in a breakpoint.

"JezB" <je***********@ blueyonder.co.u k> wrote in message
news:e6******** ********@TK2MSF TNGP11.phx.gbl. ..
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).



Nov 18 '05 #4
Ah I see. So it's not really the opposite of Session_Start ...
Is there any reliable way to capture when a user leaves my site ? I'm trying
to audit session activity.

"Marina" <so*****@nospam .com> wrote in message
news:uQ******** ******@TK2MSFTN GP11.phx.gbl...
Session_End does not fire when someone navigates elsewhere or closes the
browser. It fires when the idle timeout is reached, so you cannot do
redirects or anything with the response, if this is how you are testing
session_end firing. Try putting in a breakpoint.

"JezB" <je***********@ blueyonder.co.u k> wrote in message
news:e6******** ********@TK2MSF TNGP11.phx.gbl. ..
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).


Nov 18 '05 #5
There is really no reliable way to do anything when the user shuts their
browser window for example.

You could in theory try to capture the event in the onunload event on the
client and make some sort of call to the server to say the the user is
leaving the site. One of the issues with this, is that onunload fires
whenever the pages is unloaded - so for navigating elsewhere to your site,
or just doing a postback. So you would need to keep track of whether or not
the user just did something but stayed within your site, or is actually
leaving, which is tricky.

But overall, there is no easy way to do this, so you would just wait till
the idle timeout is reached (or the user manually logs out) to do your
cleanup.
"JezB" <je***********@ blueyonder.co.u k> wrote in message
news:e%******** ********@tk2msf tngp13.phx.gbl. ..
Ah I see. So it's not really the opposite of Session_Start ...
Is there any reliable way to capture when a user leaves my site ? I'm trying to audit session activity.

"Marina" <so*****@nospam .com> wrote in message
news:uQ******** ******@TK2MSFTN GP11.phx.gbl...
Session_End does not fire when someone navigates elsewhere or closes the
browser. It fires when the idle timeout is reached, so you cannot do
redirects or anything with the response, if this is how you are testing
session_end firing. Try putting in a breakpoint.

"JezB" <je***********@ blueyonder.co.u k> wrote in message
news:e6******** ********@TK2MSF TNGP11.phx.gbl. ..
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).



Nov 18 '05 #6

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

Similar topics

2
11381
by: Chris Sibel | last post by:
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...
9
10797
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
2797
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
1
1704
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
4722
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...
11
2813
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...
1
1629
by: Jeremy | last post by:
I am implementing a shopping cart on a project and am getting extremely frustrated because my session variable's are not persisting. After doing some research I may have discovered the source, I realized that my session_end event is firing on almost every page. The session_end event isn't supposed to fire on every page is it? If not, what are some things I can do to stop this behavior? Thanks in advance for your input! Code Below:
7
9272
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...
3
5768
by: Mufasa | last post by:
I have code in my session_start to create a temp directory for the session. On session_end it is supposed to delete the directory but doesn't seem to be firing. I've enclosed the code below. Can anybody give me any suggestions as to why Session_End seems to not be being fired? TIA - J.
0
8259
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
8192
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
8637
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...
0
8502
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
7188
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
6119
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
4090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2621
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
2
1504
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.