session_set_save_handler returns FALSE

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nyy2000
Forum Newbie
Posts: 15
Joined: Tue Jul 12, 2005 12:40 am

session_set_save_handler returns FALSE

Post 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.
nyy2000
Forum Newbie
Posts: 15
Joined: Tue Jul 12, 2005 12:40 am

Post by nyy2000 »

Problem solved.

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