|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #60551 session_set_save_handler should support a core's session handler interface
Submitted: 2011-12-17 12:16 UTC Modified: 2012-01-27 22:11 UTC
From: wiltave at gmail dot com Assigned: frozenfire (profile)
Status: Closed Package: Session related
PHP Version: Irrelevant OS: Any
Private report: No CVE-ID: None
 [2011-12-17 12:16 UTC] wiltave at gmail dot com
session_set_save_handler expects callbacks to session handler's operations (open, close, etc). It would be great if this function accepts a core's session handler interface. Something like:

interface Session_Handler_Interface {
    function open();
    function close();
    function read();
    function write();
    function destroy();
    function gc();

class Some_Handler implements Session_Handler_Interface {
    // implementations ....

$handler = new Some_Handler();

Then, we'll have an OOP approach too. The old one should not be removed.

Thank you.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-12-17 18:15 UTC]
-Status: Open +Status: Duplicate
 [2011-12-17 18:15 UTC]
Already implemented in PHP 5.4.
 [2012-01-04 01:16 UTC]
Automatic comment from SVN on behalf of arpad
Log: add SessionHandlerInterface for session_set_save_handler() - #60551
 [2012-01-04 01:18 UTC]
-Status: Duplicate +Status: To be documented
 [2012-01-04 01:18 UTC]
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

session_set_save_handler() now takes a SessionHandlerInterface, which SessionHandler implements.
 [2012-01-27 20:08 UTC]
-Status: To be documented +Status: Assigned -Assigned To: +Assigned To: frozenfire
 [2012-01-27 22:08 UTC]
Automatic comment from SVN on behalf of frozenfire
Log: Documented SessionHandlerInterface. Closes bug #60551.
 [2012-01-27 22:11 UTC]
-Status: Assigned +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 06:01:29 2024 UTC