Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 17th, 2004, 12:06 PM
Authorized User
 
Join Date: Aug 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Session_End event....

I am writing a user tracking function that I'm calling from protected Session_End event in the global.asax file. This function looks like this:

Code:
        protected void Session_End(Object sender, EventArgs e)
        {
            if(Session["ID"] != null)
                member.endSession(Int32.Parse(Session["ID"].ToString()));
        }
The endSession function make a DB call that sets a flag in a table. This ends up ending some logged in users sessions, but not all. And the timing is incosistent. Is there a better way to do this? When is this event fired?

Thanks,


-- shawn
 
Old August 17th, 2004, 03:01 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

The Session_End event fires when the session does end for a user, so I don't see how it would be an inconvenience... if you don't want the session to end, increase the session timeout property.

Brian
 
Old August 17th, 2004, 03:26 PM
Authorized User
 
Join Date: Aug 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It is not incovenient - in fact its quite the contrary; very easy to use. It doesn't work every time though. Some sessions seem to never end (the Session_End event doesn't fire) and the database calls are never made, leaving the user "Online". I am wondering what causes the session_end event to fire and if there is some circumstance that would prevent it from doing so?

-- shawn

 
Old August 18th, 2004, 07:22 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

As long as you are in InProc session state, it should fire. If the session state is set to use a state server or SQL Server, session_end will never fire.

The ways to exit the site are:

- User navigates away from site
- User closes the browser
- Browser crashes

I think the first one would be fine; don't know about the other two.

Brian
 
Old August 18th, 2004, 01:05 PM
Authorized User
 
Join Date: Aug 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

A crashed browser? We can't be talking about IE...

Thanks for your help - I will verify that we're running our app InProc.

-- shawn






Similar Threads
Thread Thread Starter Forum Replies Last Post
Global.Asax Session_End and Session.SessionID MissHenesy ASP.NET 2.0 Professional 7 November 3rd, 2009 01:20 AM
Event - Sender & Event args dash dev C# 2005 9 December 9th, 2007 07:24 AM
problemas con el evento Session_End Adlorenzo ASP.NET Espanol 2 January 22nd, 2005 03:39 PM
Session_End bmains ASP.NET 1.x and 2.0 Application Design 1 March 10th, 2004 05:41 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.