Solved

.NET GLobal.asax events - session end

Posted on 2004-08-20
2
1,345 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
Comment Utility

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
Comment Utility
Of course! thank you iHenry.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now