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

eddy1992's avatar

session and token

how to save something like cart details in a browser session ? So that user could see his cart even when he open the browser after he closes it.

0 likes
4 replies
eddy1992's avatar

Hi thanks for your response @bobbybouwmann . Do I need to store it in a token or use a token to identify the user ?

bobbybouwmann's avatar

You save whatever you want. For example the user ID. Or just the complete json string of the cart. That is up to you

masterpowers's avatar

U can use cookie if u want... Its the same as session but u can access it even after u close the browser.

Please or to participate in this conversation.