Bug #55690 [Asn->Csd]: Wrong behavior of sessionHandler
| From: | arpad@php.net | Date: | Fri, 09 Mar 2012 16:54:52 +0000 |
| Subject: | Bug #55690 [Asn->Csd]: Wrong behavior of sessionHandler | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-168307@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55690&edit=1
ID: 55690
Updated by: arpad@php.net
Reported by: laruence@php.net
Summary: Wrong behavior of sessionHandler
-Status: Assigned
+Status: Closed
Type: Bug
Package: Session related
PHP Version: trunk-SVN-2011-09-14 (SVN)
Assigned To: arpad
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2011-09-14 10:36:21] arpad@php.net
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.
------------------------------------------------------------------------
[2011-09-14 05:57:24] laruence@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] laruence@php.net
arpad plz look at this. thanks
------------------------------------------------------------------------
[2011-09-14 05:50:42] laruence@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