Skip to content

Commit

Permalink
Session->start() fix
Browse files Browse the repository at this point in the history
Now call session->start() more than one time don't cause a error
  • Loading branch information
s3b4stian committed Nov 8, 2016
1 parent 06e471d commit e7ab5a4
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/Linna/Session/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,20 @@ private function setCookie()
*/
public function start()
{
//prepare session start
$this->prepare();
if (session_status() !== 2)
{
//prepare session start
$this->prepare();

//start session
session_start();

//set new cookie
$this->setCookie();
//start session
session_start();

//link session super global to $data property
$this->data = &$_SESSION;
//set new cookie
$this->setCookie();

//link session super global to $data property
$this->data = &$_SESSION;
}

//refresh session
$this->refresh();
Expand Down

0 comments on commit e7ab5a4

Please sign in to comment.