laravel destroy session after change language #1753
Unanswered
Alessio8810
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a problem on a Laravel 10.x project
I'll start by saying that I have always used the same procedure and have never had any problems of this type
I have a multilingual site, customers arrive on the home page, make a transfer reservation by entering
departure, Arrival
and departure time
when they press the "booking" button they are redirected to a summary page where they are saved via controller all data in session
this is my route
and this is my controller
the data is saved correctly and the session data relating to the booking is displayed in the summary form.
the problem occurs as soon as I try to change the language from this page
this is route for change lang
function traduzione():
and
for information this is the middleware
the problem occurs right here, because when you return to the summary page, the form is no longer filled in with the session data and the session itself dd(Session()->all()) is empty
the strange thing I noticed is that if I go back from the browser and reload the page, I have the session data and the language selected again, I don't know how to solve it, can anyone help me?
Beta Was this translation helpful? Give feedback.
All reactions