Skip to content

Commit

Permalink
Get laminas session configuration to work
Browse files Browse the repository at this point in the history
  • Loading branch information
carlobeltrame committed Nov 8, 2020
1 parent a832b19 commit 5e413fb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions backend/config/autoload/sessions.global.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

return [
'session_config' => [
'cookie_domain' => '',
],
'session_storage' => [
'type' => 'Laminas\Session\Storage\SessionArrayStorage',
],
];
1 change: 1 addition & 0 deletions backend/config/setup.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Retrieve the list of modules for this application.
'modules' => [
'Laminas\\Router',
'Laminas\\Session',
'Laminas\\Di',
'DoctrineModule',
'DoctrineORMModule',
Expand Down
4 changes: 4 additions & 0 deletions backend/module/eCampCore/src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ public function onBootstrap(MvcEvent $e) {
$events = $app->getEventManager();
$sm = $app->getServiceManager();

// Force loading the session config, in order to force using our custom config
// See https://github.com/laminas/laminas-session/issues/15#issuecomment-569998935
$sm->get(\Laminas\Session\ManagerInterface::class);

/** @var EntityManager $em */
$em = $sm->get('doctrine.entitymanager.orm_default');

Expand Down

0 comments on commit 5e413fb

Please sign in to comment.