Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.
I'm designing an online reservation system. The plan calls for setting a hold flag in a mysql table when a reservation is started, to prevent double bookings. I'm stuck on a way to reset records if a user abandons the attempt/closes out, etc. I am considering running php cmd line to reset where timestamp x time old. But...
Is there a way to access all running sessions, to view all session id's? I store the session id in the "shopping cart" and wanted to be able to cross reference that with open sessions. Is this possible? Am I way off base here?
If you're serious about doing a real reservation system I would suggest looking into using a different database. PostGreSQL for example already handles transaction login in the database itself...
IE if the system needs to complete 3 steps but only completes 2 then everything can be rolled back and that time slot becomes available again.
however if you want to view all session ids the best way would be to use a custom session class that logs the sessions into a database instead of using the text files which it does by default.
Just a quick thought, but you could do it like this.
User starts a reservation, and it is flagged, with a timestamp.
When another user views the avalible flights/dates, whatever, the code checks for flagged items that were flagged over a certain amount of time ago and unflags them. Obviously just don't show flagged items.
pseudocode
Check if any items are flagged.
If yes, check if they are past time limit.
If they are, remove flag and proceed as normal.
If they are not, leave them and proceed.