Fix notice that the session has been already started after retrieving its id
This commit is contained in:
parent
1ad263170e
commit
5c507d5d91
|
@ -196,8 +196,15 @@ class PhpSession extends Session
|
|||
*/
|
||||
public function getId()
|
||||
{
|
||||
$this->open(); // Make sure we actually get a id
|
||||
return session_id();
|
||||
if (($id = session_id()) === '') {
|
||||
// Make sure we actually get a id
|
||||
$this->open();
|
||||
session_write_close();
|
||||
$this->hasBeenTouched = true;
|
||||
$id = session_id();
|
||||
}
|
||||
|
||||
return $id;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue