Storing session data with ADOdb and MySQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I want to store our session data in a database so that we can support multiple SquirrelMail servers, and I've been using the instructions here: http://squirrelmail.org/wiki/SessionsInDatabase to set up ADOdb.  

I think I'm missing something, possibly having to do with custom session handlers.  I've found a lot of references to session handling bugs in php4 (we're using php 5.1.6), and a great discussion that seems closely related to my problem here: http://thread.gmane.org/gmane.mail.squirrelmail.devel/8949/focus=8962

We're running SquirrelMail 1.4.15 on CentOS 5.2 and I've installed ADOdb 4.81 using the RPM php-adodb-4.81-1.el5.rf.noarch.rpm.  

Login.php is failing with the following error:

PHP Fatal error:  session_start() [<a href='function.session-start'>function.session-start</a>]: Failed to initialize storage module: user (path: /var/lib/php/session) in /usr/share/squirrelmail/functions/global.php on line 369.

session_start() was called from login.php, sqsession_is_active(), line 108, which is actually the second time sqsession_is_active gets called.  When this happens I'm left with a blank page that has an empty BODY.

I have a test script in the squirrelmail/src directory so it's subject to the same php_value auto_prepend_file of sessiondb.php as SquirrelMail and it is working fine -- logging into the database and happily storing session data.

I've searched through the SquirrelMail, PHP, and ADOdb documentation, mailing list archives, forums and everything that google can come up with and haven't found anything that solves the problem.  There are hints that session_destroy() is wiping out more than it should when it is called prior to the session_start() call that fails, but I haven't found a reference to setting up custom_session_handlers for ADOdb.

Can anyone point me in the right direction, or is there another preferred way of storing session data in a database?

Best regards,

John Simpson


sessiondb.php:
<?php
    include_once ('/var/www/adodb/adodb.inc.php');
    $ADODB_SESSION_DRIVER = 'mysql';
    $ADODB_SESSION_CONNECT = 'localhost';
    $ADODB_SESSION_USER = 'root';
    $ADODB_SESSION_PWD = '********';
    $ADODB_SESSION_DB = 'webmail';
    include_once (ADODB_DIR . '/session/adodb-session.php');
?>

adotest.php
<?php
    session_start();

    #
    # Test session vars, the following should increment on refresh
    #
    $_SESSION['AVAR'] += 1;
    print "<p>\$_SESSION['AVAR']={$_SESSION['AVAR']}</p>";
?>

--
John R. Simpson					The Reynolds and Reynolds Co.
Sr. Software Engineer				One Reynolds Way, OHA1 02-10
Hardware Architecture and Engineering	Kettering, OH 45430
Voice (937) 485-8304 Fax (937) 485-8990	mailto:John_Simpson@xxxxxxxxxx
THIS MESSAGE IS CONFIDENTIAL AND MAY CONTAIN CONFIDENTIAL INFORMATION.  IT IS INTENDED ONLY FOR THE INDIVIDUAL[S] NAMED HEREIN. IF THIS MESSAGE IS BEING SENT FROM A MEMBER OF THE LEGAL DEPARTMENT, IT MAY ALSO BE LEGALLY PRIVILEGED.   IF YOU ARE NOT THE NAMED ADDRESSEE[S] YOU MUST DELETE THIS EMAIL IMMEDIATELY.  DO NOT DISSEMINATE, DISTRIBUTE OR COPY.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
-----
squirrelmail-users mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: squirrelmail-users@xxxxxxxxxxxxxxxxxxxxx
List archives: http://news.gmane.org/gmane.mail.squirrelmail.user
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-users


[Index of Archives]     [Video For Linux]     [Yosemite News]     [Yosemite Photos]     [gtk]     [KDE]     [Cyrus SASL]     [Gimp on Windows]     [Steve's Art]     [Webcams]

  Powered by Linux