File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed
Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,28 @@ protected function getContainer(array $override_settings=[]): \Psr\Container\Con
120120 $ path_2_locale_language_files = __DIR__ . DIRECTORY_SEPARATOR . 'fake-smvc-app-root ' . $ ds .'config ' .$ ds .'languages ' ;
121121 $ locale_obj ->load ($ path_2_locale_language_files ); //load local entries for base controller
122122
123+ if (session_status () !== \PHP_SESSION_ACTIVE ) {
124+
125+ // Try to start or resume existing session
126+
127+ $ sessionOptions = $ c ->get (ContainerKeys::APP_SETTINGS )[AppSettingsKeys::SESSION_START_OPTIONS ];
128+
129+ if (isset ($ sessionOptions ['name ' ])) {
130+
131+ ////////////////////////////////////////////////////////////////
132+ // Set the session name first
133+ // https://www.php.net/manual/en/function.session-start.php
134+ // To use a named session, call session_name() before
135+ // calling session_start().
136+ //
137+ // https://www.php.net/manual/en/function.session-name.php
138+ ////////////////////////////////////////////////////////////////
139+ session_name ($ sessionOptions ['name ' ]);
140+ }
141+
142+ session_start ($ sessionOptions );
143+ }
144+
123145 // Try to update to previously selected language if stored in session
124146 if (
125147 session_status () === PHP_SESSION_ACTIVE
@@ -165,8 +187,7 @@ protected function getContainer(array $override_settings=[]): \Psr\Container\Con
165187
166188 return $ view_renderer ;
167189 });
168-
169- }
190+ } // if(!$psr11Container || $override_settings !== [])
170191
171192 return $ psr11Container ;
172193 } // protected function getContainer(array $override_settings=[]): \Psr\Container\ContainerInterface
You can’t perform that action at this time.
0 commit comments