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