Code Comments
Programming Forum and web based access to our favorite programming groups.Esteemed Perl Fellows, Is it possible to start an event when a Session ends, using Apache, mod_cgi and CGI::Session? For example: When a user enters one web page, I start one session and write a txt file. T he txt file's name is the user's session ID. So far so good. If I have a button or a link to exit my site, and the user clicks it, I can safely delete the txt file. But, if the user closes his/her browser's window ? The session is destroyed but I can't delete the file. Any way to do this as easy as in ASP (remember the global.asa file) ? Or any way at all? Note: I don't have mod_perl nor Apache::ASP :( Thanks for your time Miguel
Post Follow-up to this messageSantinho wrote: > If I have a button or a link to exit my site, and the user clicks it, > I can safely delete the txt file. Only if *every* link away from your site goes through a CGI that cleans up the session. Otherwise you won't even notice them leave. > But, if the user closes his/her > browser's window? The session is destroyed but I can't delete the file. Right. > Any way to do this as easy as in ASP (remember the global.asa file) ? ASP can't do it either. ASP isn't magic, it's just scripting embedded in a page - it can't tell any more than Perl can when a browser window closes. > Or any way at all? Easy: Just schedule a cron task that cleans up stale session files, and does any other related housekeeping at the same time. None of this is relevant to *any* c.l.perl.* news group, by the way. The answer would be the same if you were using a Python script. Try comp.infosystems.www.authoring.cgi next time. sherm-- -- Cocoa programming in Perl: http://camelbones.sourceforge.net Hire me! My resume: http://www.dot-app.org
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.