 |
| ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.x and 2.0 Application Design 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
|
|
|
|

September 3rd, 2004, 12:59 AM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Delete files on closing browser
Help needed!
I have hacked brains on this problem. No use!
I have written code to delete all temporary
data(from sql tables) and files created in the
current session. This works fine on session
timeout and logout. But it does not work if the
user closes the browser directly.
I tried onunload and onbeforeunload. Does not
work.
Any workarounds for this???
Thanks in advance.
:)Spacy
|
|

September 3rd, 2004, 10:59 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
Well No easy way. There's no way for the server to know the client closed the window- that is unless you write some kind of client program to embed in the browser- like active X... which I don't recommend.
Hal Levy
Web Developer, PDI Inc.
NOT a Wiley/Wrox Employee
|
|

September 3rd, 2004, 04:04 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Hey,
Write your own custom session...
Brian
|
|

September 5th, 2004, 11:57 PM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks for thr replies.
How do i create a custom session? Is there no way
out at all for this problem???
|
|

September 7th, 2004, 09:50 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
As I said, you can't do it. There is no way for the Server to know that the browser has closed without writing a custom program on the client. If your in a contolled enviornment (EG: Only IE 5.5 or better on company equipment) you could write something like that- if your dealing with the internet, forget about it.
Hal Levy
Web Developer, PDI Inc.
NOT a Wiley/Wrox Employee
|
|

September 7th, 2004, 02:36 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Are you using SQL Server? The only thing I can think of it store some session information in a database (specifically the Session ID), then run a process (such as DTS) that runs over night, and removes some of the data based on Sessions created the previous day. Could be complications with users early in the morning...
Brian
|
|

September 8th, 2004, 05:28 AM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks all!
I guess i will have 2 go with what bmains has written.
Yes am using session id in all my sql tables.
Thanks buddy!
|
|

September 8th, 2004, 04:24 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
You're welcome. Good luck.
|
|
 |