Aug 20th, 2009, 7:54 PM
Got distracted, but am now back to debugging this issue, here's what I found. In your session_start.php file, it's written as:
As written, the config.php file is never loaded until AFTER the session has already been created. Hence, adding the line you mentioned to my config.php didn't actually switch it to database sessions.
By re-ordering things like this:
...I'm ensured that the config.php file is read, and my setting is used. Database sessions seem to now work correctly, and I am no longer logged out at random.
At this point I just wanted to run this solution past you to check if you can see any potential problems with this re-arrangement.
Code:
if ($g_session_type == "database")
$sess = new SessionManager();
if (!empty($g_session_save_path))
session_save_path($g_session_save_path);
session_start();
header("Cache-control: private");
header("Content-Type: text/html; charset=utf-8");
$folder = dirname(__FILE__);
require_once("$folder/library.php");
As written, the config.php file is never loaded until AFTER the session has already been created. Hence, adding the line you mentioned to my config.php didn't actually switch it to database sessions.
By re-ordering things like this:
Code:
$folder = dirname(__FILE__);
require_once("$folder/library.php");
if ($g_session_type == "database")
$sess = new SessionManager();
if (!empty($g_session_save_path))
session_save_path($g_session_save_path);
session_start();
header("Cache-control: private");
header("Content-Type: text/html; charset=utf-8");
...I'm ensured that the config.php file is read, and my setting is used. Database sessions seem to now work correctly, and I am no longer logged out at random.
At this point I just wanted to run this solution past you to check if you can see any potential problems with this re-arrangement.