Edit report at https://bugs.php.net/bug.php?id=55690&edit=1
ID: 55690 Comment by: ar...@php.net Reported by: larue...@php.net Summary: Wrong behavior of sessionHandler Status: Assigned Type: Bug Package: Session related PHP Version: trunk-SVN-2011-09-14 (SVN) Assigned To: arpad Block user comment: N Private report: N New Comment: SessionHandler isn't intended to work in any other context than session_set_save_handler($handler). I'd be nervous about making such a change now anyway. However that error message is misleading. I'll update it. Previous Comments: ------------------------------------------------------------------------ [2011-09-14 05:57:24] larue...@php.net I think you can remove the PS_SANITY_CHECK, and use PS(mod) instead of PS(default_mod), this should be okey. thanks ------------------------------------------------------------------------ [2011-09-14 05:52:02] larue...@php.net arpad plz look at this. thanks ------------------------------------------------------------------------ [2011-09-14 05:50:42] larue...@php.net Description: ------------ in mod_use_class.c there is a macro: #define PS_SANITY_CHECK \ if (PS(default_mod) == NULL) { \ php_error_docref(NULL TSRMLS_CC, E_CORE_ERROR, "Called default SessionHandler but session.save_handler is user"); \ RETURN_FALSE; \ } but I think this is wrong. since, the default session.save_handler is "file", and if no new session.save_handler provide, PS(default_mod) will alyways be NULL(since default_mod only be assign in OnUpdateSaveHandler Test script: --------------- php -dsession.save_handler=files -r 'var_dump(ini_get("session.save_handler")); $x=new SessionHandler; $x->gc(1);' Actual result: -------------- PHP Fatal error: SessionHandler::gc(): Called default SessionHandler but session.save_handler is user in Unknown on line 0 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=55690&edit=1