From: brianlmoon Operating system: Linux PHP version: 5.3.15 Package: Session related Bug Type: Feature/Change Request Bug description:Empty, but set session cookies cause warning and cause sessions to not save
Description: ------------ If a session cookie is not set, a new session id will be created and all works fine. However, if for some reason the session cookie is set, but an empty string, session_start() throws a warning and custom session handlers are called with an empty session id. In addition, no session cookies are set. Test script: --------------- The test script involves setting empty cookies and such. This is the user land workaround I am using for now. if(isset($_COOKIE[ini_get("session.name")]) && empty($_COOKIE[ini_get("session.name")])){ // The cookie is empty. This is bad. unset($_COOKIE[ini_get("session.name")]); } session_start(); Expected result: ---------------- An empty session cookie should be treated the same as an unset session cookie. Actual result: -------------- Empty session cookies are treated as session ids, but warned and cause sessions to not be saved. -- Edit bug report at https://bugs.php.net/bug.php?id=62743&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=62743&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=62743&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=62743&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=62743&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62743&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=62743&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=62743&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=62743&r=needscript Try newer version: https://bugs.php.net/fix.php?id=62743&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=62743&r=support Expected behavior: https://bugs.php.net/fix.php?id=62743&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=62743&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=62743&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=62743&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=62743&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=62743&r=dst IIS Stability: https://bugs.php.net/fix.php?id=62743&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=62743&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=62743&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=62743&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=62743&r=mysqlcfg