473,378 Members | 1,496 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

end session when the browser window is closed.

sun
I want to do clean up routine to my database when the browser is closed. I
have my code in session-end - but it never fires when the browser closes. I
cant do onbeforeunload as it will be fired each time when the browser posts
back.
Somehow I want to capture browser close event and fire session abandon which
will call session end. Please help.
Thanks,
Sun
Nov 19 '05 #1
8 11474
Hi Sun,

I don't beleive you can "reliably detect" a browser closing.
Have you tried employing some type of session timeout which would fire
the session end?

Nov 19 '05 #2
Consider using HttpResponse.IsClientConnected property.

Eliyahu

"sun" <su*@discussions.microsoft.com> wrote in message
news:5E**********************************@microsof t.com...
I want to do clean up routine to my database when the browser is closed. I have my code in session-end - but it never fires when the browser closes. I cant do onbeforeunload as it will be fired each time when the browser posts back.
Somehow I want to capture browser close event and fire session abandon which will call session end. Please help.
Thanks,
Sun

Nov 19 '05 #3
sun
How or where do I have to use HttoResponse.IsClientConnected property
Sun

"Eliyahu Goldin" wrote:
Consider using HttpResponse.IsClientConnected property.

Eliyahu

"sun" <su*@discussions.microsoft.com> wrote in message
news:5E**********************************@microsof t.com...
I want to do clean up routine to my database when the browser is closed.

I
have my code in session-end - but it never fires when the browser closes.

I
cant do onbeforeunload as it will be fired each time when the browser

posts
back.
Somehow I want to capture browser close event and fire session abandon

which
will call session end. Please help.
Thanks,
Sun


Nov 19 '05 #4
Start from googling newsgroups to see how other people use it. I don't have
personal experience with it, that's why I put a careful "Consider" in my
post. Could be it doesn't help at all. Consider it. Make your own research.

Eliyahu

"sun" <su*@discussions.microsoft.com> wrote in message
news:31**********************************@microsof t.com...
How or where do I have to use HttoResponse.IsClientConnected property
Sun

"Eliyahu Goldin" wrote:
Consider using HttpResponse.IsClientConnected property.

Eliyahu

"sun" <su*@discussions.microsoft.com> wrote in message
news:5E**********************************@microsof t.com...
I want to do clean up routine to my database when the browser is
closed. I
have my code in session-end - but it never fires when the browser
closes. I
cant do onbeforeunload as it will be fired each time when the browser

posts
back.
Somehow I want to capture browser close event and fire session abandon

which
will call session end. Please help.
Thanks,
Sun


Nov 19 '05 #5
> Somehow I want to capture browser close event and fire session abandon
which
will call session end. Please help.


I think you are missing a trick. The behaviour is a feature. I think users
can close thier browser and then reconnect to thier session if it was an
accident.

What do you have to clear out? Have you got a lot of data in the session?
Nov 19 '05 #6
My personal preference is to not tied clean up to the normal application
flow. I tend to prefer to have a dedicated clean up routine that cleans
whatever needs to be cleaned.

You could use onbeforeclose but it's likely you'll find cases where it
doesn't fire (such as crashed browser etc...) plus session_end don't work
for other session providers etc...

Patrice

--

"sun" <su*@discussions.microsoft.com> a écrit dans le message de
news:5E**********************************@microsof t.com...
I want to do clean up routine to my database when the browser is closed. I have my code in session-end - but it never fires when the browser closes. I cant do onbeforeunload as it will be fired each time when the browser posts back.
Somehow I want to capture browser close event and fire session abandon which will call session end. Please help.
Thanks,
Sun

Nov 19 '05 #7
> I think users
can close thier browser and then reconnect to thier session if it was an
accident.

No, they can't, even if it was an accident.
Nov 19 '05 #8
More specifically.. once the parent window and ALL child windows (app
may have used window.open to open other windows under the same session)
have been closed.

Nov 19 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: megha | last post by:
Hi I am writing a program in JSP which requires user to log in and as he logs in database was updated with his status on and till the user does not sign out no other user with same login and...
9
by: Pack Fan | last post by:
I've noticed that session variables will persist on Mac IE even after all browser windows have been closed. One must quit the program to clear the session variables. This presents a security risk...
11
by: David Lozzi | last post by:
Hello All, I am having an issue with thus far one computer on my client's web site. If the user loads the shopping cart and then closes all browser windows, then opens them back up, goes back to...
5
by: anonmous | last post by:
Hello, I am creating a pdf via some code. Now when the pdf is created, I assign the filename to a session variable and open a new window with the pdf. Now when the user closes the pdf window, I...
5
by: Åženol Akbulak | last post by:
Hello; I use in my web application FormsAuthentication. Also I use Session state (InProc). When a user logged in, I can read Session parameters. (For example Session). Problem is that, when...
10
by: Li Pang | last post by:
Hi, I created a html page from which I give a link to another web site. The new site is opened in a new window. When I opened multiple windows, they all have the same SessionID. I want ot know...
7
by: Bill | last post by:
I've noticed that in my ASP application that session variables are not carried over from one IE6 open browser window to another. Can anyone tell me how IE can do this? It seems like it's a useful...
8
by: cyberbless | last post by:
I'm creating a basic page like the on below. Problem is evertime I refresh the page or spawn a "child window" out of the pre-existing browser the Session object is recreated with a new sessionID. ...
3
by: Arnost Sobota | last post by:
Dear ASP community, I have a question regarding ASP session variables. My assumption was that a session variable has the same lifetime as the session itself: as a consequence, given that...
16
by: Jonathan Wood | last post by:
Greetings, I was wondering if anyone here has a good understaning of the Session object. I know there are options like the Session.Abandon method and the regenerateExpiredSessionId setting,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.