[horde] Solution - Problems with a custom session handler

Rick Irvine irvine at purdue.edu
Thu Jul 11 22:34:16 PDT 2002


On Wed, 10 Jul 2002, Rick Irvine wrote:

> I have met with some interesting challenges, mostly with the fact that Horde
> now relies on the bulit in PHP session handler.  This handler currently only
> supports storing the sessions in files on the local machine.  I have a
> session handler written in PHP that redefines the handler functions to use
> the MySQL database, and this actually does work (!!).  I can see the sessions
> being stored in the table on the MySQL server and the two nodes both can
> access them.
> 
> However, now I have an interesting problem and I have to admit, I have no
> idea where to start looking.  I'm hoping someone who has more experience with
> this version of Horde can help point me in the right direction.  (My actual
> experiences with coding PHP and with Horde 2.1 are both very limited.)
> 
> Now when I click Logout, I get a blank white main window with the Horde bar
> at the bottom.  If I click Logout again at the bottom I get the correct
> behavior - another login screen.  This happens regardless of which logout
> link I initially use.

The solution was to re-call the set_session_save_handler() after the
session_destroy() in horde/imp/login.php.

Any time session_destroy() is called, you need to re-call
set_sesion_save_handler() again before another start_session().  Otherwise
the page is reloaded without the right session handler.

I found this on a tiny little note someone had posted on the bottom of one of
the php manual pages on php.net.  If someone ever decides to officially add
support for an alternate session handler, they might want to keep this in
mind.  It will save them from going through the same kind of hours of
hair-pulling I've just gone through. :)

- Rick




More information about the horde mailing list