Skip to content

Commit

Permalink
Add a isset check to make sure there is no session before creating one
Browse files Browse the repository at this point in the history
This fixes an issue in php 7.2 where by it will fail if it trys to create mutiple sessions.

https://stackoverflow.com/questions/47700336/php-7-2-warning-cannot-change-session-name-when-session-is-active

Fixes Icinga#3428
  • Loading branch information
paladox authored Apr 25, 2018
1 parent cf079fb commit 585b2a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion library/Icinga/Web/Session/PhpSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ public function __construct(array $options = null)
*/
protected function open()
{
session_name($this->sessionName);
if (!isset($_SESSION)) {
session_name($this->sessionName);
}

if ($this->hasBeenTouched) {
$cacheLimiter = ini_get('session.cache_limiter');
Expand Down

0 comments on commit 585b2a0

Please sign in to comment.