srule_
01-12-2008, 05:02 AM
The code below shows a session that is created when people log into my site. The problem I am having is that after 30mins on the site they get booted off. What I want is for them to get booted off only if they are idle for 30mins. Anyone know why my code is not archiving this?
From Login.php
// Set the session data & redirect.
session_name ('YourVisitID');
session_set_cookie_params(1800);
session_start();
$_SESSION['user_id'] = $row[0];
$_SESSION['username'] = $row[1];
$_SESSION['agent'] = md5($_SERVER['HTTP_USER_AGENT']);
header("location:$headerURL");
exit(); // Quit the script.
at the top of every member page:
session_name ('YourVisitID');
session_set_cookie_params(1800);
session_start(); // Start the session.
// If no session value is present, redirect the user.
if (!isset($_SESSION['agent']) OR ($_SESSION['agent'] != md5($_SERVER['HTTP_USER_AGENT'])) ) {
header("Location: $SiteURL");
exit(); // Quit the script.
}
From Login.php
// Set the session data & redirect.
session_name ('YourVisitID');
session_set_cookie_params(1800);
session_start();
$_SESSION['user_id'] = $row[0];
$_SESSION['username'] = $row[1];
$_SESSION['agent'] = md5($_SERVER['HTTP_USER_AGENT']);
header("location:$headerURL");
exit(); // Quit the script.
at the top of every member page:
session_name ('YourVisitID');
session_set_cookie_params(1800);
session_start(); // Start the session.
// If no session value is present, redirect the user.
if (!isset($_SESSION['agent']) OR ($_SESSION['agent'] != md5($_SERVER['HTTP_USER_AGENT'])) ) {
header("Location: $SiteURL");
exit(); // Quit the script.
}