Is there any easy way that when a session is ended, I can have a script/function run?
The id of a shopping basket on my site is put into a session variable. Once the visitor leaves, they can't get back to it, and when they return , a new basket record is created.
When the session ends (is this about 15 mins? - how do I change that?), I want it to delete the records associated with that basket (unless the order has been paid for, in which case they're needed).
In ASP, I'd have a Global.asa file in the root, which would have an On_Session_End function, which would be run each time a session is ended, and I could have some sql to delete the records.
Looking at the manual, I have to change all of the handlers
session_set_save_handler ("open", "close", "read", "write", "destroy", "gc");
which I don't really need.
It also says I gotta do my own garbage collection... I just wanted something simple!! 🙁