From: Operating system: PHP version: 5.3.3 Package: Session related Bug Type: Feature/Change Request Bug description:Expose php_session_active to userland via new function (patch included)
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 bug report at http://bugs.php.net/bug.php?id=52982&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=52982&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=52982&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=52982&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=52982&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52982&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=52982&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=52982&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=52982&r=needscript Try newer version: http://bugs.php.net/fix.php?id=52982&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=52982&r=support Expected behavior: http://bugs.php.net/fix.php?id=52982&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=52982&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=52982&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=52982&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52982&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=52982&r=dst IIS Stability: http://bugs.php.net/fix.php?id=52982&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=52982&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=52982&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=52982&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=52982&r=mysqlcfg