I think that you are looking for:
Session::keep(['someData']);
I'm using it when user for example put wrong login information to keep backUrl until login with correct one to redirect back.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi.
I am redirecting to a registration page with Session flash data using
return redirect(route('registration.student.token.create'))
->with(['authToken' => $token]);
And in the registration controller I want to reflash this data to keep it in the next session also. I do that this way:
public function create(Request $request)
{
$request->session()->reflash();
return view('registration.student.token.create');
}
If the user refreshes the page in the browser the session authToken sticks around only for the first refresh, then it disappears.
Am I wrong in thinking it should stick around no matter how much the page is refreshed?
Or am I doing it wrong?
Please or to participate in this conversation.