How to handle session? (not user authentication session)
I want to add a live meeting session that user can join and leave and have tables that record everything. The join record could be store as soon as the user join or click a button but what about leaving? What if user forgot to click the leave button? What approach to make sure that a record for both join and leave could be recorded?
What I've done previously was to have a join and leave button but user tend to forgot to click the leave button and left session incomplete. I need to manually setup session timeout like scheduler and add leave record to the user. But what could be a better way than this?
EDIT: I'd appreciate if you could leave me links for further reading since my google search only result in session related to HTTP session.
It sounds to me that you need a WebSocket solution here. WebSockets are perfect for chat sessions. Since you have a live meeting session, it's kinda the same approach. WebSockets support events whenever someone closes the browser and the connection is lost. Based on that you can perform an action. Same goes for joining a certain room.
@bobbybouwmann I also require the to notify user 10 minute prior to meeting. Does that mean I need to do cron every minute and send real time event? Sound like an expensive operation!
not to mention any app of reasonable size almost certainly has jobs that need to run periodically anyway, so running cron on a regular basis to ensure scheduled tasks fire is always a good thing.