On Wed, Feb 4, 2009 at 6:02 PM, Matt Feifarek <[email protected]> wrote: > On Wed, Feb 4, 2009 at 3:10 PM, Mike Orr <[email protected]> wrote: >> >> You don't know when the user closes the browser. In fact, you don't >> know anything after the user's last request, whether you will hear >> from them again or not. > > Right, but I've always wanted this... although it is stateless, there is > still an event we can use. > > The appserver knows when it cleans up or expires the session... couldn't we > do an event hook there, something like "on_expire()"?
That would be useful for the case of sessions that have external resources to clean up. I got a private question this week about having per-user SQLAlchemy engines. Those can't be pickled so they can't be stored in the session, so I suggested putting a dict on pylons.app_globals for them, but again you have the problem of expiring them. Pylons/Paste doesn't have a cron scheduler to sweep through and expire old sessions, but maybe it's time we added that. Or rather... it would only work with PasteHTTPServer. mod_wsgi doesn't have a Python server process to trigger the events or run them in. -- Mike Orr <[email protected]> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
