// 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(); } }