Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

deladels's avatar

suggestion on rerouting users to loginpage and rerouting back to their previous page.

so while working on my final year project, i decided to allow the users to browse through the up without having to be logged in since theres's this thing in UX/UI that says forcing users to login before viewing anything on an app is a deterrent.

so i am asking for you options on how to allow the user to browse through till where they'll have to make a booking or lets say till they get to the checkout page for example. now before they click on the place order button, i want to redirect them to login or register page and then sending them back to the order page.

any suggestions will be grateful.

0 likes
6 replies
bobbybouwmann's avatar

Well you have multiple options there, but I think the best solution is using a session. You simply store their order in the session and when a user logs in you check if you have an order in the session. If you have you simply redirect them to the correct page and apply the order on that page ;)

Let me know if that works for you!

deladels's avatar

oh okay. that will mean i have to manually put the values into the session.cuz when i do a dd() i get null atm.

deladels's avatar

is it possible to do something like this?

<input class="validate" type="text" name="lastName" placeholder="Enter Last Name" value="{{ Session::get('lastName') }}">

bobbybouwmann's avatar
Level 88

Sure! However I would save the full order in the session instead of having a session for each field. You can also store arrays in the session ;)

1 like

Please or to participate in this conversation.