// vendor/laravel/framework/src/Illuminate/Session/Store.php
// 添加下面方法,然后在需要的地方,Session::hasSession()
public function hasSession(){
return $this->handler->read($this->getId()) ? true : false;
}
//
public function resetId($id)
{
$this->flush();
$this->id = $id;
if($this->hasSession()){
$this->loadSession();
}
}