how to detect Browser close event.

S

sm mehta

Hi,

I have a web Application that must be licensed. When Customer buys 2
licensees for my application they can only have 2 copies open at a time.
What I am doing right now is, I am storing No. Of License in the SQL
Table, and on each connection i would reduce 1 license from the DB. My
problem is when user closes IE Browser, I want to capture this event and
return the license to the DB. How do I know when user closed the
browser? I have more than one page in my application so from any page if
they close browser I should capture that event. I also have Automatic
refresh on couple of pages where it redraws pages from the DB every 5
mins. I should not clear the license upon refresh. I would really
appreciate your help.

Thanks
SM.
 
D

David

There's an event in your global.ascx that triggers when a
session ends. You might want to try updating your DB here.

Sub Session_End(ByVal sender As Object, ByVal e As
EventArgs)
' Fires when the session ends
End Sub
 
N

Natty Gur

In addition to David replay,

pay attention that the default session ending is 20 minutes after the
user last request to the server, you can change it in the web.config.

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
 
B

bruce barker

there is no way to reliably catch this event on the server. as the browser
doesn't maintain a connection to your server, you can only guess at number
of concurrent users.

you will need to implement a license checkout scheme. every page request
need to check out a license, that has a short timeout. if none availiable
then report error. on postback the page send the license, if its still vaild
or an additional one is available, the post succeeds, otherwise report out
of license error. the postback will also release the license. if the
postback renders a new page, a new checkout is done.

-- bruce (sqlwork)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top