I've written a web application that creates lots of temp files. There's no way to tell which will be ultimately 'kept' until the user actually leaves the site. It would be nice if all users logged off, just as it would be if devil's food with fudge icing supplied all our needed nutriments.
I understand why JavaScript has no 'onClose' function (when the site closes, there's no JavaScript left alive). PHP, however, being server-side, could be addressed by a closing browser. A function could be triggered. All irrelevant files could be 'unlinked'.
I'm kind of new here. I haven't found any reference to anything remotely resembling such a function in the manual.
Any chance there's one lurking in some library somewhere? Or, am I off on another quixotic tangent?
Any help would be greatly appreciated.