Skip to content
Advertisement

Unable to retrieve data stored on Laravel session on subsequent requests

I am writing a programme that requires a multi-step form before all the validated data will be stored in the database. For instance, Users have to provide their personal information before proceeding to the next step, and I want the validated data to be stored as a session up till the user completed its registration before all the data will be stored in a database.

Here is my code so far:

JavaScript

The session is only accessible on the next request but not on subsequent requests

Advertisement

Answer

First, make an array of data.

JavaScript

Then finally check the validation and put the data into a session with key and value.

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement