|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8308 custom session handlers...
Submitted: 2000-12-17 23:10 UTC Modified: 2000-12-18 20:38 UTC
From: ben at efros dot com Assigned:
Status: Closed Package: Session related
PHP Version: 4.0 Latest CVS (17/12/2000) OS: slackware 7.1 w/2.4 kernel
Private report: No CVE-ID: None
 [2000-12-17 23:10 UTC] ben at efros dot com
session_set_save_handler(.... list of handlers ...);

When I actually run the above code, the open handler is run.
 The read handler is run, but then the write handler is not
executed.  Shouldn't it be executed when session_register()
is read?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-18 04:09 UTC]
Have you set session.save_handler in php.ini to user?

 [2000-12-18 12:34 UTC] ben at efros dot com
Yes the session module is set to "user" (this is done
automatically by session_set_save_handler() I believe).
Initially executing the script the handler was set to files,
but then I let the set_save_handler change it over to the
'user' module.  I have also tried to forcefully set the
handler to user, but still the "write" handler never seems
to be executed.

 [2000-12-18 17:16 UTC]
Please read this manual page carefully:

 [2000-12-18 20:38 UTC] ben at efros dot com
php.ini does not require session.save_handler to be set to
'user' in order to manage user sessions.

session_set_save_handler() appears to auto-change the
handler to 'user' when called.

the resolution to my problem is that the "write" call
actually occurs AFTER the output is sent to the webserver.
So my debug output was now displaying when echo'd... i had
to save to a file instead.

This may be something that needs to get added to the
official documenation... that the "write" handler doesnt
occur real-time, but at the end of handling the script.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Feb 05 04:05:48 2023 UTC