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 ...
|
|||||||
|
|
#1 (permalink) |
|
Junior Member
Join Date: Nov 2008
Posts: 1
Rep Power: 0 ![]() |
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");
?>
|
|
|
|
| Sponsored Links | |
![]() |
| Bookmarks |
|
|
| Thread Tools | |
| Display Modes | |
|
|
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 |