CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > migration_to_asp.net.migrating_from_asp_to_asp.net Tags:
Item Type: NewsGroup Date Entered: 11/14/2007 11:07:02 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 10 Views: 56 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
11 Items, 1 Pages 1 |< << Go >> >|
lax4u
Asp.Net User
how to end ASP session when user close browser?11/14/2007 11:07:02 PM

0/0

How do i end Classic ASP session when user close broswer. Again its not asp.net. i'm asking about Classic ASP

hans_v
Asp.Net User
Re: how to end ASP session when user close browser?11/15/2007 1:04:01 AM

0/0

Create a new page abandon.asp with the following content

<% Session.Abandon %>
And then change the body tag of you existing page in:

<body onunload="window.location.href='abandon.asp';">

codemister
Asp.Net User
Re: how to end ASP session when user close browser?11/15/2007 6:51:25 AM

0/0

When the user closes the browser the session ends automatically irrespective of it being ASP, ASP.NET 1.1 or 2.0 .

If you want to do something when the session ends you'll need to add it to the

Sub Session_OnE in the  Global.asa file 

 


Sub Session_OnE
End Sub

 


Ritesh Ramesh

If this answered your question, be sure to mark it as the answer. That way, everybody after you will know it's the answer also!
codemister
Asp.Net User
Re: how to end ASP session when user close browser?11/15/2007 6:52:48 AM

0/0

When the user closes the browser the session ends automatically irrespective of it being ASP, ASP.NET 1.1 or 2.0 .

If you want to do something when the session ends you'll need to add it to the

Sub Session_OnE in the  Global.asa file 

 


Sub Session_OnE
End Sub

 


Ritesh Ramesh

If this answered your question, be sure to mark it as the answer. That way, everybody after you will know it's the answer also!
lax4u
Asp.Net User
Re: how to end ASP session when user close browser?11/15/2007 6:46:45 PM

0/0

i may be wrong here, but i dont think in classic ASP session gets end, when u close the broswer. the session_end event gets fire only when session.timeout period reach.

hans_v
Asp.Net User
Re: how to end ASP session when user close browser?11/15/2007 9:12:46 PM

0/0

codemister:

When the user closes the browser the session ends automatically irrespective of it being ASP, ASP.NET 1.1 or 2.0 .

If you want to do something when the session ends you'll need to add it to the

Sub Session_OnE in the  Global.asa file 

Sub Session_OnE
End Sub

If you'll run a simple test you'll notice that this is not true!

jimmy q
Asp.Net User
Re: how to end ASP session when user close browser?11/15/2007 9:30:24 PM

0/0

codemister:
When the user closes the browser the session ends automatically irrespective of it being ASP, ASP.NET 1.1 or 2.0 .
 

I believe that is incorrect.

When the browser is closed, this is a client side event, ASP.NET does not know this unless you fire off an async request etc.

What will happen is the session will time out instead. 

lax4u
Asp.Net User
Re: how to end ASP session when user close browser?11/16/2007 10:17:44 PM

0/0

thats what i'm saying it will timeout. it means if session timeout set to 20 mins and browser is closed before 20 mins session will be there in memory and it will end when timeout period reach.

hans_v
Asp.Net User
Re: how to end ASP session when user close browser?11/16/2007 10:48:07 PM

0/0

so did you try my javascript solution?

lax4u
Asp.Net User
Re: how to end ASP session when user close browser?11/20/2007 3:24:52 PM

0/0

hans, we have thousands of asp pages so i can do that for every page. but tried following. I set seesion for 20 mins.I have some code in global.asa in session_end event. i put break point there and attach global.asa to debugger.  i run the application close it. It DID NOT hit the session_end event. but after 20 mins it hits the session_end event even when my application was not running. So that conclude if i dont abandon session manually when we close broswer, session will keep running in memory.
hans_v
Asp.Net User
Re: how to end ASP session when user close browser?11/20/2007 5:02:34 PM

0/0

I'm not sure what you're trying to say? As you've tested, session_end will only execute after 20 minutes (or whatever session value you set it), even when you have closed you browser before. The only way you can catch that a browser is close is with javascript (<body onunload="window.location.href='abandon.asp';">), which in turn will invoke session.abondon on the server.

And although you have thousands of asp pages, usually the body tag is somewhere in an include file which is included in all pages. If so, this is very easy to implement!

 

11 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Mastering ASP.NET with C# Authors: A. Russell Jones, Pages: 816, Published: 2002
Beginning ASP.NET 1.1 with VB.NET 2003 Authors: Chris Ullman, John Kauffman, Chris Hart, David Sussman, Pages: 888, Published: 2003
Beginning Dreamweaver MX 2004 Authors: Charles E. Brown, Imar Spaanjaars, Todd Marks, Pages: 792, Published: 2004
Beginning ASP.NET 2.0 in VB 2005: From Novice to Professional Authors: Matthew MacDonald, Pages: 1063, Published: 2006
Beginning ASP.NET 3.5 in VB 9.0: From Novice to Professional Authors: Matthew MacDonald, Pages: 1149, Published: 2007
Beginning ASP.NET 1.1 with Visual C# .NET 2003 Authors: Chris Ullman, John Kauffman, Chris Hart, Dave Sussman, Daniel Maharry, Pages: 888, Published: 2004
Beginning Object-Oriented ASP.NET 2.0 with VB.NET: From Novice to Professional Authors: Brian R. Myers, Pages: 193, Published: 2005
Design of Industrial Information Systems Authors: Thomas O. Boucher, Ali Yalcin, Pages: 432, Published: 2006
Beginning ASP Databases Authors: John Kauffman, Kevin Spencer, Thearon Willis, Pages: 856, Published: 2003

Web:
ASP 101 - When Sessions End - Once And For All! A session also ends if the user closes the web browser, ... much common sense that closing a browser doesn't end a session but nothing suprises me. anyway, ...
how to end ASP session when user close browser? - ASP.NET Forums how to end ASP session when user close browser? Last post 11-20-2007 12:02 PM by hans_v. 10 replies. Sort Posts:. Oldest to newest, Newest to oldest ...
how to end ASP session when user close browser? - ASP.NET Forums how to end ASP session when user close browser? Last post 11-20-2007 12:02 PM by hans_v. 10 replies. Sort Posts: ...
Ending Session when user close window ? - ASP.NET - Forums at ... Ending Session when user close window ?: Hi there! Im a newbie in ASP.NET. Now I meet a logout problem. That is: If the user close the browser instead of ...
How to end a session when the user closes the browser? ASP Net - How to end a session when the user closes the browser? ... I'm afraid that you can't close the session without waiting the timeout ...
How to end a session immediately when the browser closes? - ASP.NET Sessions DO NOT end when a user closes their browser. ... The session object is killed when they close the browser (i know you store ...
How to end session after closing the window? : session, end, close Hi, How can I end ASP session (programmatically) after I close browser? ... ' Session_OnEnd Runs when a user's session times out or quits your application ...
What factor determine a session to end? - .NET ASP What happen a user close the browser or switch to other website? Does the session end immediately or 20 minutes later? ...
Counting current users online in ASP | Code Tricks- Tips and ... Jan 28, 2008 ... The code above will give the session variable user the value of a random number. ... our site or close their browser. The Application Object ...
End User Sessions When the Browser Closes With Remote Scripting ... 3. if the user uses Alt-F4 to close the browser, you will NOT log them out. ... vm instance of my app does not end the session upon closing of the browser. ...




Search This Site:










error on installation

using forms authentication with httpwebrequest.getresponse()

vs team test

why use new project for modules data providers?

please help on it

how to: accessing config file mail settings programmatically

encrypting a form email?

anything new on the wizard front ?

permission problems when editing

making changes to core - files to ftp

createuserwizard problem

publish error

session vars

dnn deployment error...please help

[:$] web controls not working when built

unable to download pubs database script

localhost does not work, 127.0.0.1 does...

asking for an idea: how to check if the client is online

error creating edit control <asp:hyperlink navigateurl='

multipage and dropdowns problem

how to use activedirectorymembeshipprovider combine with menu and role manager?

wheres the best place for learning authorization?

how to create an adapter for the sitemappath control? how to handle the various templates (rootnodetemplate, currentnodetemplate, nodetemplate...)?

solution : webcontrol & collections & imageurleditor & design time

new to security(encryption and cryptography)

overwrite validationsummary control

sorry for the 2nd one

additional informations should be written into user profiles using userconfiguration wizard

dnn 2.1.2 database error

ssl on localhost

 
All Times Are GMT