What Im making is a basic shopping basket. Now Im not too familiar sessions so I might be missing something here, but I figured I could use session id to store a number of fields in a database- ie; if add to cart button is pressed it would store the session id, product id n quantity or whatever, n then id just call them up from the database to display them in the cart.
ok thats simple, n if i could gurantee each user would end their session on a set page, i could put a delete query on that page, but of course that is never going to happen, so what im thinking is could it be made so mysql periodically deleted sessions.. sayyy perhaps store the time n date, n it deletes entries once theyre more than a day old or something like that?
I cant just think how this would be done.. perhaps with a query on the main page that would run everytime someone entered the site? It all just seems a bit untidy.
Is there an easier way, or an easier way to store items in the cart that Im missing? or does this sound ok to you guys?