When a user leaves my website, and right before the session times out I would like to be able to run a script that send me an email.
I have looked into a few different ways, for example, using JavaScript. However I found these methods are unreliable.
I came acrosssession_set_save_handler
but I am not sure if this is what should use or if there is a better method of doing this.
Thanks for any help. Also a tutorial on how I can do this would be awesome.