-1

In laravel,I'm using redirect function to redirect to another controller with values,like redirect('my-page,with['value1']=>$values) and im getting the values using session->flash(),I got the values,but if I refresh the page,my values are gone,how to solve it

Tried many methods if the page was refreshed,I got null values

  • Flash is flash - this is one time values. You can pass values with query string or store in session. – Maksim Jul 07 '23 at 15:01
  • Does this answer your question? [Set session variable in laravel](https://stackoverflow.com/questions/28417796/set-session-variable-in-laravel) – miken32 Jul 07 '23 at 16:02

1 Answers1

0
Session::put('value1', $values);
return redirect('my-page');

in other controller:

Session::get('value1');
kris gjika
  • 531
  • 2
  • 8