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.php script ...

Go Back   AJAX Forums > Beginners AJAX > AJAX Questions

AJAX Made Easy


AJAX Questions Ask Ajax Questions Here!

Reply

 

LinkBack Thread Tools Display Modes
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

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 On
HTML code is Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Out of these 3, what is the best and safest web browser? chihuahua lover Web 3.0 9 10-20-2009 08:12 AM
.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


All times are GMT -4. The time now is 02:59 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.0
Copyright ©2006 - 2009, AJAXwith.com