Solved

.NET GLobal.asax events - session end

Posted on 2004-08-20
2
1,378 Views
Last Modified: 2012-06-21
I have a procedure in the global.asax Session_End event which does not appear to be executing when the application is closed (ie. I shut down the browser). State is inproc. Any suggestions?

I am using VS.NET in debug mode and framework 1.1. Code in the event is:

Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
        ' Fires when the session ends
        Dim objCart As New Providence.ShoppingCart
        objCart.DeleteCart(Session.SessionID)
End Sub

I am using the sessionID as a unique (hopefully) key in the cart table. And I want to make sure any records are deleted if the user abandons the session.
0
Comment
Question by:ravl
2 Comments
 
LVL 20

Accepted Solution

by:
ihenry earned 50 total points
ID: 11871414

Session_End won't fire if you close your browser. HTTP is a stateless protocol, and the server has no way to know if your browser has been closed. Try running your application in debug mode, with a short <sessionState> timeout attribute. Visit the page and then wait. Wait until the End event kick in.
0
 
LVL 1

Author Comment

by:ravl
ID: 11876545
Of course! thank you iHenry.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When deciding to adopt any help desk solutions many factors should be explored before taking decisions. This will change from business to another but in general there are some kind of rule of thumb. Here are some quick tips: Do we need only ticket…
Now that Expression Web 4.0 (http://www.microsoft.com/expression/products/Upgrade.aspx) is free if you buy or have the full version of Expression Web 3.0, now is the best time to  migrate from FrontPage to Expression Web (http://www.frontpage-to-exp…
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question