AJAX Forums

destroy sessions on closing browser tab

This is a discussion on destroy sessions on closing browser tab within the AJAX Questions forums, part of the Beginners AJAX category; hi all just joined. i have my lougout.php which destroys sessions and session ids on logout. I want to have same effect means i want to call this logout....


Go Back   AJAX Forums > Beginners AJAX > AJAX Questions

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
Old 11-22-2008, 02:05 AM   #1 (permalink)
Junior Member
 
Join Date: Nov 2008
Posts: 1
Rep Power: 0 vinpkl is on a distinguished road
destroy sessions on closing browser tab

hi all

just joined.

i have my lougout.php which destroys sessions and session ids on logout. I want to have same effect means i want to call this logout.php script when the user closes the "browser tab".

as these are the days of "browser tabs" so this is very important for me.

when the user closed the whole browser then all session and session ids are destroyed automatically
but these sessions are not destroying when the user closes the "browser tab".

Its not possible with javascript but its possible with AJAX. I have not used ajax uptil now and have no knowledge. So it would be great if somebody helps me with calling my logout.php script on closing "browser tab".

Code:
<? require_once("config.php");
$unique_id = session_id(); 
session_regenerate_id();
$qry="delete from cart_table where unique_id='$unique_id'";
mysql_query($qry);
$_SESSION = array(); 
session_unset();
session_destroy();
header("Location:index.php"); 
?>
vineet
vinpkl is offline   Reply With Quote
Sponsored Links
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
.NET in the Browser: Silverlight RIA microbee AJAX Help 0 03-06-2008 01:52 AM
.NET in the Browser: Silverlight RIA microbee AJAX Help 0 01-31-2008 09:15 PM
.NET in the Browser: Silverlight microbee AJAX Help 0 01-10-2008 02:05 AM
Out of these 3, what is the best and safest web browser? chihuahua lover Web 3.0 8 06-25-2007 10:31 AM


All times are GMT -4. The time now is 06:58 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5
Copyright ©2006 - 2008, AJAXwith.com