i have a session that goes back to my logon screen when the session expires, but when i check if the session expired, it goes like this:
the script that checks whether the session is valid is included in all the pertinent pages where the session exists....
what could be wrong?
Warning: Cannot modify header information - headers already sent by (output started at /usr/local/www/data-dist/scripts/test/verify_session.php:9) in /usr/local/www/data-dist/scripts/test/verify_session.php on line 27
the code is:
<?php
$expire = (session_cache_expire() * 60);
echo "<br>" . ($_SESSION['time'] + $expire);
echo "<br>" . time();
if(($_SESSION['time'] + $expire) < time()){
$_SESSION['status'] = 'expired';
}
if ($_SESSION['status'] == "logged_in")
{
//no action
// also we can put statistics here too if we want in the future.
}
if ($_SESSION['status'] == "logout")
{
$_SESSION['status'] = "logged_in";
header("location: [url]http://www.mylocation/scripts/test/login.php?message=[/url]".urlencode("loggedout"));
}
if (($_SESSION['current_session'] != $_SESSION['session_user']."=".$_SESSION['session_key']) || ($_SESSION['status'] == "expired"))
{
header("location: [url]http://www.mylocation/scripts/test/index.html?message=[/url]".urlencode("expired"));
}
?>