From 0c43a0ce498303b11350c96352f32630e281a1fe Mon Sep 17 00:00:00 2001 From: michael Date: Wed, 15 Jan 2003 08:27:01 +0000 Subject: [PATCH] added debug logging moved session_start to Session class --- lib/control.inc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/control.inc b/lib/control.inc index a7e2338..2d43df6 100644 --- a/lib/control.inc +++ b/lib/control.inc @@ -69,25 +69,26 @@ function generateLink($action) { function checkSession() { global $default; - session_start(); $session = new Session(); $sessionStatus = $session->verify(); - // ??: do i need all this stuff? + if ($sessionStatus["status"] != 1) { // verification failed, redirect to login with error message + $default->log->debug("checkSession:: session check failed"); $url = "/login.php?loginAction=loginForm"; $redirect = $_SERVER[PHP_SELF]; - //echo "redirect url = $redirect
"; if (strlen($redirect) > 1) { - // not redirecting to login, so this session verification failure - // represents either the first visit to the site - // OR a session timeout etc. (in which case we still want to bounce + $default->log->debug("checkSession:: redirect url=$redirect"); + // this session verification failure represents either the first visit to + // the site OR a session timeout etc. (in which case we still want to bounce // the user to the login page, and then back to whatever page they're on now) $url = $url . "&redirect=" . $redirect; } + $default->log->debug("checkSession:: about to redirect to $url"); redirect($url); } else { + $default->log->debug("checkSession:: returning true"); return true; } } -- libgit2 0.21.4