473,782 Members | 2,396 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Session_End Event does not Fire.

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 points,
writes to a database table, and writes to a text file to indicate when this
event fires. So far I have got nothing back. Yet I am able to verify the
the session has timed out. I have no indication of code failure, but nothing
happens when this event is supposed to fire. I really do need this so
information would be hugely appreciated.

ERJ MCSD MCDBA.

Nov 19 '05
11 2828
I used one of our few MS support calls and got the answer direct from the
source.
ERJ MCSD MCDBA.

Nov 19 '05 #11
Hans,

At this point try putting a try catch around your OnSessionEnd Code.

Try
'---Your code here
Catch ex As Exception
Dim Test As String = "Place a breakpoint on this line and examine ""ex""
if the breakpoint is hit"
End Try

It's possible that your code is throwing an error before any breakpoint you
set is hit. This test may catch something.

Otherwise please show the code for your entire OnSessionEnd (Including all
the code even the declaration of the even handler.)
--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"OldProgram mer" <Ol***********@ discussions.mic rosoft.com> wrote in message
news:3A******** *************** ***********@mic rosoft.com...
See above my post 9/19/05 1:25 PST

Here:

Dim swObject As StreamWriter 'Text Stream Object
Dim sPath As String

sPath = Server.MapPath( "testClose.txt" )

swObject = File.CreateText (sPath)
swObject.Write( "closing" & CStr(Now()))
swObject = Nothing
"S. Justin Gengo" wrote:
May we see your OnSessionEnd method?

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"OldProgram mer" <Ol***********@ discussions.mic rosoft.com> wrote in
message
news:63******** *************** ***********@mic rosoft.com...
> The original question specifies
> 1. First tried to run needed code, then
> 2. Tried to write to dB table (hardcoding all connection strings and
> values), then
> 3. writing to a plain vanilla text file.
> 4. I tried setting the web.config file to show time out value of 2
> minutes.
> Then when that did not work reset it back to 20 minutes and waited one
> hour.
> All the seesion variables are gone and the application behaves as it is
> supposed to when the session variables have been lost. The only thing
> that
> did not happen was the write to the DB table then text file.
>
> So I know the session did time out.
>
>
> "S. Justin Gengo" wrote:
>
>> On top of that setting a breakpoint won't work. .NET connects to the
>> web
>> app
>> and listens to what it's doing in order to hit breakpoints. I believe
>> that
>> will keep the session open.
>>
>> I would set a write to a database/text file inside of the session end
>> handler, set your session time out to one minute (or less), compile
>> the
>> application, connect to it manually outside of .NET
>> (http://localhost/yourappnamehere), and then step away for a water or
>> soda.
>> When you come back the write should have occurred.
>>
>> --
>> Sincerely,
>>
>> S. Justin Gengo, MCP
>> Web Developer / Programmer
>>
>> www.aboutfortunate.com
>>
>> "Out of chaos comes order."
>> Nietzsche
>> "Hans Kesting" <ne***********@ spamgourmet.com > wrote in message
>> news:e%******** ********@TK2MSF TNGP12.phx.gbl. ..
>> > OldProgrammer wrote:
>> >> 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 points, writes to a
>> >> database table, and writes to a text file to indicate when this
>> >> event
>> >> fires. So far I have got nothing back. Yet I am able to verify
>> >> the
>> >> the session has timed out. I have no indication of code failure,
>> >> but
>> >> nothing happens when this event is supposed to fire. I really do
>> >> need this so information would be hugely appreciated.
>> >>
>> >> ERJ MCSD MCDBA.
>> >
>> > You didn't specify, but when do you expect the Session_End to
>> > occur? It's 20 minutes (by default) after the last request for this
>> > session, not (as a lot of people assume) as soon as the browser
>> > closes or the user "navigates away".
>> >
>> > Hans Kesting
>> >
>> >
>>
>>
>>


Nov 19 '05 #12

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();
3
1651
by: Mark Field | last post by:
Assuming that IIS is not restared, and that the web server is not restarted, should the "session_end" event in the global file ALWAYS fire or will there be times when it will not fire? protected void Session_End(Object sender, EventArgs e) { }
3
566
by: Guadala Harry | last post by:
Just wondering if Session_End *always fires* for every Session. I know that IIS times out sessions after a default 20 min (unless changed) and there's no way to know when a user actually closed a browser (unless I provide a "log out" button that kills the session explicitly, and we can't guarantee the user will click on that). What I am wondering if there are there well-known/documented circumstances under which Session_End will NOT fire...
4
3114
by: news.microsoft.com | last post by:
For some odd reason, session start fires but session_end does not. I am running the web server inproc, the web.config is configured as: <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="true" timeout="1"
3
1610
by: MattB | last post by:
Hi. I have a couple of questions regarding the Session_End event. I have some clean-up code in this event and it does fire when the session times out, which is good. I also want to have this (or similar) code fire when the session ends prematurely, like when the browser window is closed or Session.Clear is called. It appears that does not happen, but is there any way I can force it or is there a different event that would fire in these...
7
1754
by: T. | last post by:
Does the Session_End event actually fire? I am building an ASP.NET application, and so far I have an HTML page and a single asp page. The HTML is the home page. I have code in the Global.asax file's Session_End handler that closes the session's connections to the SQL backend. The thing never fires! After my app closes, I run sp_who in Query Analyzer to see connections to the database. Low and behold my ASP connections are still there! What...
8
5770
by: Roger | last post by:
When I call the session.abandon() method, it calls the session_end event. When a user closes the browser or clicks the log off button, I can dispose of objects and abandon the session cleaning. But, when a user either navigates away from the web app and when the session timesout, the session_end event does not seem to fire. Or when else can I dispose of objects? Or is there an event I can you that is fired when a user navigates away from...
12
10700
by: =?Utf-8?B?QWxleCBNYWdoZW4=?= | last post by:
Hi. I am trying to maintain a list of people who are currently "online" in SQL. I do this by adding a simple entry to a simple PeopleOnline table whenever someone logs in to my site. If they manually log OUT of the site, I have no problem deleting them from the PeopleOnline table. But if they just close the browser, I was assuming I'd have to use the Session_End() event in Global.asax even though I know that this will only occur once the...
5
2765
by: Ron J | last post by:
I would like to keep track of users when they are 'on'. On Session_Start I can write a DB record about them, but there does not seem to be session variable information during the Session_end event which I could use to update the record that they are logged out. This would also be nice to limit multiple logins. Is there a preferred way to track users login / logout /session time and multiple logins ? TIA
0
9641
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
9480
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
10313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10146
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
8968
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
7494
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
5378
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
4044
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
3
2875
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.