Jeroen
|
| Posted: 07/25/2002, 2:29 AM |
|
Hi,
I have build a shop with sessions. Instead of storing the products in the cart in a cookie I write it to a database, because a lot of people visiting the site have older and incompatible browsers or deny the cookies because of privacy. But a lot of people put products in the basket and then leave the site. Therefore a lot of products stay in the database table. Is there a way to automaticly delete data from a table when it's expired or on exiting the site?
I use CCS with MySQL and PHP.
|
|
|
 |
Nicole
|
| Posted: 07/26/2002, 6:37 AM |
|
Jeroen,
you can create a script that will delete all the records where the difference between date_posted and current date is greater than given value. It's more system scripting than web scripting. You should run this script with some job scheduler , e.g. cron on linux
|
|
|
 |
Jeroen
|
| Posted: 07/26/2002, 7:52 AM |
|
Thanks Nicole, I was thinking about that too. But I thought maybe it could be different. But this will also do the job.
|
|
|
 |
George L.
|
| Posted: 07/28/2002, 6:28 PM |
|
Jeroen. Just add your custom delete actions to the Logout() function the CCS provides. That's what I did. You can then have any delet from table ... action on logouts
|
|
|
 |
Jeroen
|
| Posted: 07/29/2002, 2:06 AM |
|
George,
I don't use the login. Everybody gets a session id, instead of a UserID.
But thank you for your reply.
|
|
|
 |
|