Followup question: Does the 'with' function flash the session data in, so it is lost after one use?
Jan 12, 2018
4
Level 1
Losing session after displaying view
Laravel 5.5, session driver is 'file'
I have a set of routes wrapped in web middleware.
in ProcessForm1, I set up an array with some proposed session variables:
$data = [
'user_id' => $me->UserID,
'pin' => $pin,
'password_reset_id' => $pr->id,
'username' => $me->UserName,
'mobile_number' => $mobile_number,
];
then:
return redirect()->to('/forgotpassword/delivery')->with($data);
When I arrive at /forgotpassword/delivery (ShowForm2) I have the session variables, and after doing nothing more than:
$me = User::find($user_id);
$email = $me->Email;
$mobile = $me->MobileNumber;
I return a view:
return view('auth.passwords.happy_reset_2', ['captcha' => $captcha, 'email' => $email, 'mobile' => $mobile]);
The view submits to processForm2 where I no longer have the session variables shown above in the data array.
Any help appreciated.
Please or to participate in this conversation.