Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/289.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Laravel 5注销或会话销毁_Php_Laravel - Fatal编程技术网

Php Laravel 5注销或会话销毁

Php Laravel 5注销或会话销毁,php,laravel,Php,Laravel,我在注销laravel 5.1应用程序时遇到问题-我认为问题在于会话没有被破坏 我的问题几乎与以下相同: 我的解决方案是使用 session_unset(); 而不是 Session::flush(); 因此,我注销laravel 5.1应用程序的工作解决方案是: public function getLogout() { \Auth::logout(); session_unset(); return redirect(property_exists($this,

我在注销laravel 5.1应用程序时遇到问题-我认为问题在于会话没有被破坏

我的问题几乎与以下相同:

我的解决方案是使用

session_unset();
而不是

Session::flush();
因此,我注销laravel 5.1应用程序的工作解决方案是:

public function getLogout()
{
    \Auth::logout();
    session_unset();
    return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/');

    //these attempts will not remove values from the session.....

    //session()->forget('db');
    //\Session::flush();


}
知道为什么
\Session::flush()
会话()->忘记('db')不工作

你能试试这个吗:

Auth::logout();
Session::flush();
如果它不工作,请检查Config->Session.php中的
“'driver'=>'file'”
“'domain'=>null”
部分。

试试这段代码

Auth::logout();

试试这个代码

使用Illumb\Support\Facades\Session


会话::flush();不起作用。session_unset();确实有效。驱动程序设置为文件,域设置为空。我想知道这是否是我的开发环境,这使我需要建立一个不同的开发环境。我将尝试在本周六通过Skype帮助您。你能把我加入skype吗:alierdemsunar。
session_unset();
Session::flush();
public function logout()
{
    Auth::logout();
    Session::flush();
    return redirect('/login');
 }