Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics 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 July 19th, 2007, 06:40 AM
Friend of Wrox
 
Join Date: Oct 2006
Location: Northampton, Northants, United Kingdom.
Posts: 114
Thanks: 0
Thanked 0 Times in 0 Posts
Default Session_OnEnd Question....

I have added a simple stored procedure into the Session_OnEnd of my global.asa ... which doesn't seem to be run when the webpage is closed.

I have run the SQL Profiler and the query isn't being run at all.

Could I be missing something?

The procedure has been tested in a normal page, so I know that it works.

Regards,

Sean Anderson
__________________
Regards,

Sean Anderson
 
Old July 19th, 2007, 07:59 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

I think I have seen this question on the forum half a dozen times! In any event, the Session_OnEnd event does NOT fire when you close the browser, it is fired when the Session expires on the server.

hth

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
 
Old July 19th, 2007, 08:04 AM
Friend of Wrox
 
Join Date: Oct 2006
Location: Northampton, Northants, United Kingdom.
Posts: 114
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The commented line of code in the global.asa is a little misleading then (Runs when a user's session times out or quits your application) as it implies it will run.

I guess that I will have to capture it from a function in the main page.

Regards,

Sean Anderson
 
Old July 19th, 2007, 03:54 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Well, yes and no. Both of the statements in the global.asa are true as the Session_OnEnd event will fire in both of those situations BUT, you need to remember, HTTP is a stateless protocol so when I click the close button in my browser, unless you have some form of code setup to notifiy the server that I am closing the window, the server has no idea that I have closed my browser.

To explicitly call Session_OnEnd (aka quitting an application) you can call Session.End or Session.Abandon and, of course, it is called after the user has been idle for X mins. (Where X is the timeout period of the session)

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========




Similar Threads
Thread Thread Starter Forum Replies Last Post
session_onend and databases scottlet Classic ASP Databases 2 May 30th, 2007 04:47 AM
session_onend does not trigger vbarbin Classic ASP Professional 1 March 16th, 2007 02:02 PM
help with session_onend chinedu Classic ASP Basics 8 October 26th, 2004 10:13 PM





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