Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/session/2.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.0中获得另一个页面会话值?_Php_Session_Laravel_Laravel 5 - Fatal编程技术网

Php 如何在laravel 5.0中获得另一个页面会话值?

Php 如何在laravel 5.0中获得另一个页面会话值?,php,session,laravel,laravel-5,Php,Session,Laravel,Laravel 5,我已经在AuthenticatesAndRegistersUsers.php文件中设置了会话变量,这个值是使用session:all()laravel默认函数在我的控制器中获得的 因此,它不是在该控制器上显示,而是在AuthenticatesAndRegistersUsers.php页面上显示 以下是我的AuthenticatesAndRegistersUsers.php页面代码: use Session ; ...... if ($this->auth->

我已经在
AuthenticatesAndRegistersUsers.php
文件中设置了会话变量,这个值是使用
session:all()
laravel默认函数在我的控制器中获得的

因此,它不是在该控制器上显示,而是在
AuthenticatesAndRegistersUsers.php
页面上显示

以下是我的AuthenticatesAndRegistersUsers.php页面代码:

    use Session ;

    ......

    if ($this->auth->attempt($credentials, $request->has('remember')))
    {
        session()->regenerate();
        Sesstion::put('admin','admin');
        session(['key' => 'value']);
        return redirect()->intended($this->redirectPath());
    }

    return redirect($this->loginPath())
                ->withInput($request->only('email', 'remember'))
                ->withErrors([
                    'email' => $this->getFailedLoginMessage(),
                ]);
   ......
下面是我的控制器代码

  use Session;

    ..........       

  public function index()
  {
    session()->regenerate();
    dd(Session::all());exit;
    return view('/admin/index');   
  }
  .......

删除
session()->重新生成()来自控制器代码

某段时间,它会导致FatalErrorException类“Illumb\Foundation\Auth\Sesstion”未找到,这是因为会话拼写错误。这不是会话,有时最好仔细阅读错误。就像达芬奇密码一样,解决方案也在谜题中:)@AndreiP。只是打字错误,还是不行