Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

t0berius's avatar

data get's deleted from session

I've got two controller actions handling POST requests.

first:

    //store email & password in session
        $request->session()->put('email', $request->email);
        $request->session()->put('password', $request->password);

second:

    //store agb accepted
        $request->session()->put('agb_accepted', 'true');
        //redirect to enter PIN
        return view('enter_pin');

After storing the AGBs I've included

{{ dd(session()->all()) }}

inside my "enter_pin" view. After the first submit of agb_accepted form the value is set to the session, but when I reload the enter_pin page only the "agb_accepted" is "deleted". The values of email and password are stored fine.

-Any idea where things go wrong?

0 likes
3 replies
tisuchi's avatar

Can you try directly calling session()?

Session()->put();
1 like
tisuchi's avatar

Did you check by printing default user session?

Please or to participate in this conversation.