Bug #75628 [NEW]: session_set_save_handler() prints warnings in a unit test

From: Date: Tue, 05 Dec 2017 08:38:37 +0000
Subject: Bug #75628 [NEW]: session_set_save_handler() prints warnings in a unit test
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212928@lists.php.net to get a copy of this message
From: damyon at moodle dot com Operating system: Linux Mint 17.3 Rosa PHP version: 7.2.0 Package: Session related Bug Type: Bug Bug description:session_set_save_handler() prints warnings in a unit test Description: ------------ When unit testing session-related code in a CLI environment, appropriate PHP ini settings combined with passing false to session_cache_limiter should allow the session handler to be changed even if output has been already sent. With PHP 7.2.0RC5 calling session_set_save_handler prints warning messages, regardless of php ini settings. Very similar previously fixed bug: https://bugs.php.net/bug.php?id=55267 Very similar (but not the same) bugs with php 7.2 https://bugs.php.net/bug.php?id=74936 https://bugs.php.net/bug.php?id=74514 Test script: --------------- <?php S> ini_set('session.use_cookies', false); ini_set('session.use_only_cookies', false); ini_set('session.use_trans_id', 1); ini_set('session.cache_limiter', false); session_cache_limiter(false); echo '.'; class MySessionHandler extends SessionHandler { S> } $handler = new MySessionHandler(); session_set_save_handler($handler, true); Expected result: ---------------- One single dot of output Actual result: -------------- .PHP Warning: session_set_save_handler(): Cannot change save handler when headers already sent in [filepath]/test.php on line 17 -- Edit bug report at https://bugs.php.net/bug.php?id=75628&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75628&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75628&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75628&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=75628&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=75628&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=75628&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=75628&r=needscript Try newer version: https://bugs.php.net/fix.php?id=75628&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=75628&r=support Expected behavior: https://bugs.php.net/fix.php?id=75628&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=75628&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=75628&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=75628&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75628&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=75628&r=dst IIS Stability: https://bugs.php.net/fix.php?id=75628&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=75628&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=75628&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=75628&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=75628&r=mysqlcfg

« previous php.bugs (#212928) next »