Dear Friends,
I am following the bestuff.com's active member session.
I am doing the following thing...
1. when user logs in, I update my database's field with value 'O' (means user is logged in and fires query which has flag value 'O')
But the problem is how to check user's status when User closes browser?
I set 10 minutes session time out but it only works when user refreshes or visits the page.
Please help me out of this... hell...
Please reply me fast and please admin section also take part in this query/problem...
Thanks in advance
index.php
----------
session_start();
if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > 600))
{
// last request was more than 30 minates ago
//session_destroy(); // destroy session data in storage
//session_unset(); // unset $_SESSION variable for the runtime
header("location:logout.php");
}
$_SESSION['LAST_ACTIVITY'] = time(); // update last activity time stamp
logout.php
----------
session_start();
include_once 'commoninclude.php';
$objLogin=new MySQLConnection();
$objLogin->Open();
$updateMemberOnlineStatus="Update tblMemberRegistration Set OnlineStatus='F' Where ID=".$_SESSION['memberid'];
$objLogin->UpdateQuery($updateMemberOnlineStatus);
$objLogin->Close();
session_unset();
session_destroy();
header("location:index.php");
but the above code does not working...
please help