Umm Okay..
The reason I didn't post the code to begin with was because it spans many pages and many lines..
So here is the short version:
Problem is, when session.php is reached, loginid and userid are blank, no session array is populated..
works on this page:
<?
// Page for the main site..
// Of course, first we check the cookies
// First - this page will be used to set session too ..
$TIMEOUT_VAL = 300;
// Let's checkt o see if we are setting the sessions..
if ($_GET['sess'] == 'y') {
session_start();
$_SESSION['loginid'] = $_GET['i'];
$_SESSION['userid'] = $_GET['u'];
$_SESSION['last_access'] = time() + $TIMEOUT_VAL;
} else
require_once('/home/drago353/public_html/global/session.php')
require_once('/home/drago353/public_html/global/df-standard.php'); //Requirments for pages
// We've passed, let's go on through
$u = $_SESSION['userid'];
$i = $_SESSION['loginid'];
if ($_GET['l'] == 'n') {
header("location: [url]http://df.com/events/main/index_home.php?u=[/url]$u&i=$i&l=n");
} else {
header("location: [url]http://df.com/events/main/index_home.php?u=[/url]$u&i=$i");
}
?>
But not this one:
<?
require_once('/home/drago353/public_html/global/session.php'); //Session setup
require_once('/home/drago353/public_html/global/df-standard.php'); //Requirments for pages
require_once('main/class_main.php');
$tpl = new evtMain;
$tpl->assign('date', strftime('%B %d, %Y (%a)', time()));
$tpl->assign('displayname', $tpl->make_display_name($_SESSION['i']));
$tpl->display('welcome.tpl');
?>
Contents of session.php
<?
//session.php
// This verifies that the session has started, if not, resbumitts to login
// This should be the First included page
session_start();
$TIMEOUT_VAL = 300; // Debug - 5 min, normal 2700
if ($_GET['l'] == 'o') { // Logout
header('Location: [url]http://df.com/events/[/url]');
exit(0);
}
if ($_SESSION['loginid'] == '' || $_SESSION['userid'] == '') {
header('Location: [url]http://df.com/events?errcd=9d[/url]');
}
// Check the timeout
$now = time();
if ($_SESSION['last_access'] + $TIMEOUT_VAL < $now) {
print_r ($_SESSION);
$to = ($_SESSION['last_access'] + $TIMEOUT_VAL);
$_SESSION = array(); // Clear
session_destroy();
header("Location: [url]http://df-ent.com/events?errcd=9c&1=[/url]$to&2=$now");
} else { // update
$_SESSION['last_access'] = $now;
}
?>
Originally posted by m@tt
No code = no solution, simple : )