I'm already doing a good bit of database batch processing from cronjobs and wanted to avoid more, so after more thinking about it, I've decided to come at the problem from a different approach. Instead of trying to write all of the objects to the database, I'll keep the values for the objects in the session (since there is no actual processing to do to them) and when a set of data meets the test criteria, I'll serialize it to the database. Nothing gets written to the databsase that I don't want to keep.
Thanks for the answer ! I spent quite a few hours looking for a way to catch session expiration: short of starting some kind of timer when the session is generated, I couldn't find any way to do it. Now at least I know it's not possible. - Gabriel Comeau On Sun, Aug 22, 2010 at 10:38 AM, pghoratiu <[email protected]> wrote: > There is no such thing, a session may expire also because of user > inactivity thus there is no way to catch this on the server side. Even > in case the browser is closed nothing is sent to the server to signal > the session end (like a logout). > > In case you store the user sessions in the database you could develop > a cron job that would scan the session table for recently expired > sessions (running that task every minute) and make it part of the > session cleanup process. > In case the default PHP session storage is used (files on the disk) > the sessions get GC-ed by the PHP engine and you will not be able to > get expired sessions unless you disable this in php.ini. > > gabriel > > > On Aug 22, 6:17 am, Gabriel Comeau <[email protected]> wrote: > > Hello, > > > > I am storing an array of object IDs in the session, and storing the > objects > > themselves in the database. When the user's session expires (ie - they > > close their browser) I want to test the saved objects for certain > > conditions, and delete the ones that don't meet these conditions. What > I'm > > looking for is the place to make this call. > > > > Browsing the API docs, I've found that there is a shutdown() method of > the > > sfUser class, but it seems to be run at the end of every request, so that > > won't work. > > > > Can anyone point me in the right direction? > > > > Thanks very much, > > > > Gabriel Comeau > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected]<symfony-users%[email protected]> > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" 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/symfony-users?hl=en
