Hello everyone 
i migrated a project from zf2 to laminas, everything went kinda smooth, but its an pretty old project. Now i want to make some elements in a better practice way and also include PHPUnit-Tests.
But my first test directly gets “smashed” because of some settings in my Module.php, to be more clear in the onBootstrap function.
- ApplicationTest\Controller\IndexControllerTest::testIndexActionCanBeAccessed
ini_set(): Headers already sent. You cannot change the session module’s ini settings at this time
/var/www/vendor/laminas/laminas-session/src/Config/SessionConfig.php:147
/var/www/vendor/laminas/laminas-session/src/Config/StandardConfig.php:146
/var/www/vendor/laminas/laminas-session/src/Config/SessionConfig.php:105
/var/www/vendor/laminas/laminas-session/src/Config/StandardConfig.php:115
/var/www/module/Application/Module.php:441
/var/www/vendor/laminas/laminas-eventmanager/src/EventManager.php:321
/var/www/vendor/laminas/laminas-eventmanager/src/EventManager.php:178
/var/www/vendor/laminas/laminas-mvc/src/Application.php:310
/var/www/vendor/laminas/laminas-test/src/PHPUnit/Controller/AbstractControllerTestCase.php:319
/var/www/module/Application/test/Controller/IndexControllerTest.php:31
My Module.php looks like this:
$sessionConfig = new SessionConfig();
$options[‘use_only_cookies’] = ‘off’;
$options[‘use_trans_sid’] = ‘on’;
$options[‘use_cookies’] = ‘on’;
$options[‘name’] = ‘PHPSESSID’;
$options[‘cookie_httponly’] = false;
$sessionConfig->setOptions($options);
Is this the wrong “position” to setup some session config stuff? Where would this code belong to?
I got quite a lot code in the onBootstrap Part. Is there any rescource, how i could face that issue and make this legacy Project better?
Greetings from Germany
mhaendler