Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > Other ASP.NET > ASP.NET 1.x and 2.0 Application Design
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 3rd, 2004, 12:59 AM
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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







  #2 (permalink)  
Old September 3rd, 2004, 10:59 AM
Friend of Wrox
Points: 3,489, Level: 24
Points: 3,489, Level: 24 Points: 3,489, Level: 24 Points: 3,489, Level: 24
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Central, NJ, USA.
Posts: 1,102
Thanks: 0
Thanked 2 Times in 2 Posts
Default

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
  #3 (permalink)  
Old September 3rd, 2004, 04:04 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

Write your own custom session...

Brian
  #4 (permalink)  
Old September 5th, 2004, 11:57 PM
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for thr replies.

How do i create a custom session? Is there no way
out at all for this problem???




  #5 (permalink)  
Old September 7th, 2004, 09:50 AM
Friend of Wrox
Points: 3,489, Level: 24
Points: 3,489, Level: 24 Points: 3,489, Level: 24 Points: 3,489, Level: 24
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Central, NJ, USA.
Posts: 1,102
Thanks: 0
Thanked 2 Times in 2 Posts
Default

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
  #6 (permalink)  
Old September 7th, 2004, 02:36 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

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
  #7 (permalink)  
Old September 8th, 2004, 05:28 AM
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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!



  #8 (permalink)  
Old September 8th, 2004, 04:24 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

You're welcome. Good luck.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
closing browser prv299 ASP.NET 2.0 Professional 1 June 5th, 2008 09:15 AM
browser closing vamsivaila Pro Java 0 January 3rd, 2007 06:43 AM
Determine method of closing browser chrscote Javascript How-To 2 August 31st, 2006 05:34 AM
Closing browser using a Button MichaelTJ ASP.NET 1.0 and 1.1 Basics 3 December 18th, 2003 02:06 PM



All times are GMT -4. The time now is 08:48 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.