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

DavP2021's avatar

how to store laravel session in local storage or web storage

i need to save form data in order to return them on page refresh, then clear the form when a button is clicked. a good example is the shopping cart so it remain with user session

0 likes
4 replies
shez1983's avatar
shez1983
Best Answer
Level 23

well to store in local storage, you would need the help of JS. laravel i dont think can do this for you.

whats wrong with the good old session/cookies to store cart data?

DavP2021's avatar

thanks for answer, i honestly do not know how to go about the session/cookies, please can you help with that, the items in the cart clear every time page refreshes below is the opening tag of the form where the items added

<form action="{{ route('agent.check') }}" method="post" class="card rounded-0 border-top-0 border-left-0" id="check">
jlrdw's avatar

If you are ready for shopping cart programming you should already know about sessions and cookies and how to properly use them.

You seriously need to take more training or tutorials before you proceed.

Please or to participate in this conversation.