I have a reservation system that currently reserves tickets for 5 minutes, after which they get released. Unfortunately this is still causing problems as users may browse away from the site or close their browser window leaving those reservations locked until the time-out. I could reduce the time-out but this would be a problem for users who are still completing a form or whatever on the site.
Basically I'm asking if there is a reliable way to detect if a user has left the site, either by browsing to another domain or closing their browser window?
I was thinking of calling the ticket release function with an ajax call from the browsers onunload event, but that would mean that it would be called even if they were just browsing between pages on my site.
Is there a way of getting the next url to be loaded from within the onunload call? I guess adding an ajax call for every page unload is going to be an additional strain on the server... probably a bad idea all-round.
Basically I'm asking if there is a reliable way to detect if a user has left the site, either by browsing to another domain or closing their browser window?
I was thinking of calling the ticket release function with an ajax call from the browsers onunload event, but that would mean that it would be called even if they were just browsing between pages on my site.
Is there a way of getting the next url to be loaded from within the onunload call? I guess adding an ajax call for every page unload is going to be an additional strain on the server... probably a bad idea all-round.