Wrox Programmer Forums
|
ASP Pro Code Clinic As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Pro Code Clinic 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
 
Old February 7th, 2005, 02:22 PM
Registered User
 
Join Date: Feb 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Session_End when browser close

hi, we have a problem.. we have a web application where we want to have a control about the users that login and logout to validate that only a session (or window) its open by user, then when the user login we save a status that indicate that the user is online and when the user is logout save the status offline, but the problem is when the user close the browser or shutdown his computer, we dont have register about that, what can we do?? :( help me!!

 
Old February 7th, 2005, 02:26 PM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Vadivel Send a message via Yahoo to Vadivel
Default

You might want to check this :: http://p2p.wrox.com/topic.asp?TOPIC_...hTerms=vadivel

Best Regards
Vadivel

MVP ASP/ASP.NET
http://vadivel.thinkingms.com
 
Old February 15th, 2005, 01:46 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hii Imar,Vadivel,Sheela

For my asp page ,I use this script that call session_onEnd method(global.asa).
Since my Client Applications run on FullScreen Pop up window,i used this technique.

Will closing with main browser
It will give follwoing message
 The Web page you are viewing is trying to close the window
  Do you want to close this window?

Looking for your opinions too :)


<script>

function closeSession()
{
 //capturing ALT + F4
 if (event.altKey==true && event.keyCode==0 )
{
  //alert("closed1")
 document.location.href="SessionEndFile.asp";
   window.close();
  }

Xwidth=window.document.body.offsetWidth-window.event.clientX
YHeight=window.event.clientY
if(Xwidth<=30&&YHeight<0)
{
  // alert("closed2")
 document.location.href="SessionEndFile.asp";
   window.close();

}

}
window.onbeforeunload=closeSession

//or we can use body(unload) method

</script>

now simply "SessionEndFile.asp" is like

<% Session.Abandon %>



Cheers :)

vinod





Similar Threads
Thread Thread Starter Forum Replies Last Post
Browser close when screen saver close Rehanrana Pro VB 6 1 April 7th, 2008 03:09 AM
Close Browser Window MoisesZaragoza Javascript How-To 2 February 6th, 2007 08:02 PM
How to close browser window? rupen Javascript How-To 14 July 31st, 2006 10:52 AM
How to close a browser session ? elisabeth Pro JSP 2 April 11th, 2004 11:30 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.