0

Hi all ...

During a session a user causes information to be added to a temporary database table. At the end of the session, the information has to be removed. How can I tell when a session has ended so that I can clear the rows from the table that belonged to that session id?

Regards ...

G-fer

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by g-fer
0

Hi all ...

During a session a user causes information to be added to a temporary database table. At the end of the session, the information has to be removed. How can I tell when a session has ended so that I can clear the rows from the table that belonged to that session id?

Regards ...

G-fer

I think I understand what you are asking. :)

If I were you, when someone logged in and created a session, I would get the session_id() and store it in the database. Then, I would have a cron job that would scan the temporary database at a sane interval (10-15min) and check to ensure the session_id() still exists. You should be able to find the path to the session using session_save_path(), which tells you where your session files are going.

Not a coded answer, but a big nudge in the right direction, I think.

My 2¢. Hope it helped. :)

0

Hi Wraithmanilian,

Thanks for the answer. It's perfect... solves a few other problems too.

I gotta spend more time thinking outside the square :)

Regards .... G-fer

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.