Whats the best way to store data between pages in PHP? I would have thought sessions work well, or even object sessions (https://stackoverflow.com/a/5515341/1445985) But lets say I was building a shopping cart, are PHP sessions really so easily hackable that it isnt advisable to store cart/basket data in them? Who cares anyway if someone did manage to get someone else's basket data, it wouldn't do any harm surely? Obviously credit card data etc is harmful but a list of different products in an order would not be a worry at all.
I have seen a shopping cart that I currently work with (I didnt make it) store every order into a table in a DB and then just query the table by Order ID to retrieve all the order information. Is this advisable?
I am constantly trying to find the best ways to do things in PHP and the problem is there never seems to be one trustworthy way to do anything. There is always someone saying that it's a bad idea.