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

From: Date: Tue, 05 Dec 2017 08:48:08 +0000
Subject: Bug #75628 [Opn]: session_set_save_handler() prints warnings in a unit test
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212929@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75628&edit=1 ID: 75628 User updated by: damyon at moodle dot com Reported by: damyon at moodle dot com Summary: session_set_save_handler() prints warnings in a unit test Status: Open Type: Bug Package: Session related Operating System: Linux Mint 17.3 Rosa PHP Version: 7.2.0 Block user comment: N Private report: N New Comment: Sorry the test script has "S>" lines in it (copy / paste problem). Previous Comments: ------------------------------------------------------------------------ [2017-12-05 08:38:34] damyon at moodle dot com 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> 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> 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 this bug report at https://bugs.php.net/bug.php?id=75628&edit=1

« previous php.bugs (#212929) next »