I'm wondering if anyone can help me with this: I'm working on a "who's logged in" type of thing using sessions. I have them being written to a certain directory on my server so I can just extract the file names. The question is how would I set this so the session would be deleted a certain amount of time after being written?
Thanks for any help.
-erin
My theory is that you should put a timestamp on your sessions table, and then either run a cronjob to delete old sessions, or when someone logs in, delete all of their sessions that are older than some threshhold. Those seem the most reasonable and easiest to implement.
Good luck!
-Andy
So, you can either regularly run a program that will delete all files older than some threshold, or when someone logs in, you can delete all of their older sessions, or delete the ones older than some threshold (so that they can be logged in twice at the same time)
? cron job? makes no sense to me.
If you're asking what a cron job is, I described it a bit in that thread to which I referred you. It's a way by which you can have commands executed on a regular basis. If you're on a windows machine, I think there's something like a command scheduler you can use or something like that. You can use this so that you can regularly delete old sessions.