I am developing a online store. There is no sign up option. So i used Ajax and PHP to keep users wishlists and carts. For that i create some text file on the server.
Is that okay, or there is better way to do that?
Second question is; if I want to delete those text files after a certain period of time automatically, is it possible?
For storing information you might want to lookup MySQL or other type of database.
For dealing with information expiry date you can do two things:
added_on
field with current datetime. Upon retrieval, check if that date is older than required period of time and use it accordingly.added_on
date and use CRON jobs to check once in a while if that entry is older than required period of time and if it is, delete it.