You are talking about the Session_End in the global.asa if I'm following you right, I don't believe there is an equivalent to that in PHP yet (remember, the idea of sessions is still relatively new in PHP). If there is, I'd be happy to hear about it as well.
For all you PHP guys who don't have an IIS background/ASP background, the IIS server starts a session the second a new user comes into the system and ends it either when a script forces the end or after a set amount of time expires (default is 20 minutes). The website has a global.asa file which instructs the server what to do with the session when it begins and ends (and when an application begins and ends as well). You have the option of leaving it at default (do nothing/do nothing) or you can tell it to initialize variables, run routines to set up user sessions, etc. At the end of the session, the global.asa has the other set of instructions that tells it to do whatever, such as what Ludvik is wanting to do.
Any ideas?
Jim Hawley