Page 1 of 1

session_set_save_handler returns FALSE

Posted: Thu Nov 03, 2005 10:09 pm
by nyy2000
I am trying to manage sessions by PostgreSQL with Mojavi.
Mojavi seems to have this feature, so I just commented out and edit some lines.

Here it is:

Code: Select all

require_once(SESSION_DIR . 'PgSQLSessionHandler.class.php');
$params = array('table' => 'sessions');
$dbstring = 'host='.DB_HOST. ' port='.DB_PORT.' user='.DB_USER.' password='.DB_PASSWORD.' dbname='.DB_NAME;
$sessHandler =& new PgSQLSessionHandler( $dbstring, $params );
$controller->setSessionHandler($sessHandler);
But it is not using DB, intead it is using file as usual.
I dumped the variable in a function dispatch in mojavi-all-classes.php to see what the problem is; session_set_save_handler is returning FALSE, and I think because this fails, the sessions are saved in files as default setting is.

I changed error_reporting to E_ALL, but nothing shows up. What could be the reasons of session_set_save_handler returning FALSE?

---

Sorry for using code tag with php coding and thank you for fixing it.

Posted: Fri Nov 04, 2005 12:22 am
by nyy2000
Problem solved.

session.auto_start was on, so that was preventing custom session_handler to be set.