If you do not want to lose your data, use files with ACID verification.
What kind of winnings are you looking for?
If you want a secure system, you cannot trust anything from the user, with the possible exception of the selected integers, so letting them store information is usually a very bad idea.
I do not see a gain for storing sessions outside your MySQL database. You can clean the cron on the tables if this is your concern, but why bother? Some users will shop on the site and then be distracted for a while. Then they will return in a day or two.
If you use cookies or something really temporary to store session information, there is a really good chance that your purchase time was wasted. Users really value their time ... therefore, if you saved session information in a database, you can write something sexy to manage that data.
In addition, a nice side effect of this is that you will create a lot of residual information about what you like on your website, which may not be available to you later. Just as you might even think it looked like a survey or something where people adding products to their shopping cart can influence how you manage your business, order inventory, or focus your marketing.
If you go with something really temporary, you lose the residual benefits.
Geekster
source share