Laravel sessions regenerating on every load

后端 未结 8 2274
盖世英雄少女心
盖世英雄少女心 2021-02-18 19:05

I\'m having a lot of problems and I really can\'t seem to find a solution.

Yesterday, I finished up doing some work on a vagrant box in Laravel. When I shut down the com

8条回答
  •  花落未央
    2021-02-18 19:31

    My problem was that I had echo statements in my function. It was keeping the session from being properly created/stored.

    I had an echo before my 'return Redirect' so the redirect didn't get the session...

    public function login()
    {
        // auth
        if (Auth::attempt(Input::only('email', 'password'), true))
        {
            return Redirect::route('companies.index');
        }
        // failed -> back to login
        return Redirect::back()->withErrors(['email' => 'Login failed.'])->withInput();
    }
    

    Details: http://brainwashinc.com/2014/02/17/laravel-sessions-not-working-in-4-1/

提交回复
热议问题