Req #52982 [Opn->Asn]: Expose php_session_active to userland via new function (patch included)
| From: | kalle@php.net | Date: | Mon, 04 Oct 2010 08:31:44 +0000 |
| Subject: | Req #52982 [Opn->Asn]: Expose php_session_active to userland via new function (patch included) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-154879@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52982&edit=1
ID: 52982
Updated by: kalle@php.net
Reported by: php dot net at kenman dot net
Summary: Expose php_session_active to userland via new
function (patch included)
-Status: Open
+Status: Assigned
Type: Feature/Change Request
Package: Session related
PHP Version: 5.3.3
-Assigned To:
+Assigned To: kalle
Block user comment: N
New Comment:
If we are going to expose php_session_active, we might aswell expose the
other values. I will cook up a patch and apply it to trunk shortly
Previous Comments:
------------------------------------------------------------------------
[2010-10-04 04:45:37] php dot net at kenman dot net
Description:
------------
Attempting to start a session after a session has already been started
raises an
E_NOTICE, however, there is no sane way to check if a session has
already been
started. The only ways that I could devise were using the shut-up op (@)
or by
creating wrapper functions around all of the session functions.
This is extreme because there exists in the PHP source, code which can
do this; my
patch exposes this code for userland comsumption.
More info:
http://stackoverflow.com/questions/3788369/how-to-tell-if-a-session-is-active
Test script:
---------------
session_start();
// 1000's of lines of code, which may/may not have closed the session
session_start(); // how to tell if a session is active here?
Expected result:
----------------
Should be able to ask PHP whether or not it knows of an active session.
Actual result:
--------------
Notice: A session had already been started - ignoring session_start()
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52982&edit=1