Hi everyone, I am a newb. Can anyone tell me how to do session cleanup? I want to cleanup those sessions which haven''t been modified in recent 5 minutes. How to make it a background process in my rails application? thanks in advance, xiahong
Do you mean how to timeout a session, or clean up old sessions in the database (when using table-based session, opposed to cookie-based sessions)? Cheers, Nicholas On Jun 24, 11:22 pm, Xiahong Gao <gaox...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi everyone, > > I am a newb. Can anyone tell me how to do session cleanup? I want to > cleanup those sessions which haven''t been modified in recent 5 > minutes. How to make it a background process in my rails application? > > thanks in advance, > > xiahong
yes.. 2009/6/25, Nicholas Henry <nicholas.henry-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> > > Do you mean how to timeout a session, or clean up old sessions in the > database (when using table-based session, opposed to cookie-based > sessions)? > > Cheers, > Nicholas > > > On Jun 24, 11:22 pm, Xiahong Gao <gaox...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hi everyone, > > > > I am a newb. Can anyone tell me how to do session cleanup? I want to > > cleanup those sessions which haven''t been modified in recent 5 > > minutes. How to make it a background process in my rails application? > > > > thanks in advance, > > > > xiahong > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
yes to which one? On Thu, Jun 25, 2009 at 3:08 PM, gaoxh gaoxh04<gaoxh04-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> yes.. > > 2009/6/25, Nicholas Henry <nicholas.henry-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: >> >> Do you mean how to timeout a session, or clean up old sessions in the >> database (when using table-based session, opposed to cookie-based >> sessions)? >> >> Cheers, >> Nicholas >> >> >> On Jun 24, 11:22 pm, Xiahong Gao <gaox...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> > Hi everyone, >> > >> > I am a newb. Can anyone tell me how to do session cleanup? I want to >> > cleanup those sessions which haven''t been modified in recent 5 >> > minutes. How to make it a background process in my rails application? >> > >> > thanks in advance, >> > >> > xiahong >> >
sorry for confusion. for databased session 2009/6/25 Nicholas Henry <nicholas.henry-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> > yes to which one? > > On Thu, Jun 25, 2009 at 3:08 PM, gaoxh gaoxh04<gaoxh04-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > yes.. > > > > 2009/6/25, Nicholas Henry <nicholas.henry-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > >> > >> Do you mean how to timeout a session, or clean up old sessions in the > >> database (when using table-based session, opposed to cookie-based > >> sessions)? > >> > >> Cheers, > >> Nicholas > >> > >> > >> On Jun 24, 11:22 pm, Xiahong Gao <gaox...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> > Hi everyone, > >> > > >> > I am a newb. Can anyone tell me how to do session cleanup? I want to > >> > cleanup those sessions which haven''t been modified in recent 5 > >> > minutes. How to make it a background process in my rails application? > >> > > >> > thanks in advance, > >> > > >> > xiahong >> > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Here''s any example of a rake task that cleans out sessions that are some many weeks old: http://topfunky.net/svn/plugins/topfunky_power_tools/tasks/database.rake You can call the rake task in a cron job, but clearing them out every five minutes seems a little extreme. I wondering if you are after something to timeout the session if it hasn''t been modified for the last five minutes. Then you are after something like SessionTimeout: http://github.com/lukeredpath/session-timeout/tree/master HTH, Nicholas On Jun 25, 6:28 pm, gaoxh gaoxh04 <gaox...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> sorry for confusion. for databased session > > 2009/6/25 Nicholas Henry <nicholas.he...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > > > > yes to which one? > > > On Thu, Jun 25, 2009 at 3:08 PM, gaoxh gaoxh04<gaox...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > yes.. > > > > 2009/6/25, Nicholas Henry <nicholas.he...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > > >> Do you mean how to timeout a session, or clean up old sessions in the > > >> database (when using table-based session, opposed to cookie-based > > >> sessions)? > > > >> Cheers, > > >> Nicholas > > > >> On Jun 24, 11:22 pm, Xiahong Gao <gaox...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > >> > Hi everyone, > > > >> > I am a newb. Can anyone tell me how to do session cleanup? I want to > > >> > cleanup those sessions which haven''t been modified in recent 5 > > >> > minutes. How to make it a background process in my rails application? > > > >> > thanks in advance, > > > >> > xiahong >>
Or if you are using MySQL 5.1 as a backend for your session you have the ability to schedule a task that can delete the sessions that are 5min or older. On Jun 25, 5:53 pm, Nicholas Henry <nicholas.he...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Here''s any example of a rake task that cleans out sessions that are > some many weeks old: > > http://topfunky.net/svn/plugins/topfunky_power_tools/tasks/database.rake > > You can call the rake task in a cron job, but clearing them out every > five minutes seems a little extreme. I wondering if you are after > something to timeout the session if it hasn''t been modified for the > last five minutes. Then you are after something like SessionTimeout: > > http://github.com/lukeredpath/session-timeout/tree/master > > HTH, > Nicholas > > On Jun 25, 6:28 pm, gaoxh gaoxh04 <gaox...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > sorry for confusion. for databased session > > > 2009/6/25 Nicholas Henry <nicholas.he...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > yes to which one? > > > > On Thu, Jun 25, 2009 at 3:08 PM, gaoxh gaoxh04<gaox...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > yes.. > > > > > 2009/6/25, Nicholas Henry <nicholas.he...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > > > >> Do you mean how to timeout a session, or clean up old sessions in the > > > >> database (when using table-based session, opposed to cookie-based > > > >> sessions)? > > > > >> Cheers, > > > >> Nicholas > > > > >> On Jun 24, 11:22 pm, Xiahong Gao <gaox...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > >> > Hi everyone, > > > > >> > I am a newb. Can anyone tell me how to do session cleanup? I want to > > > >> > cleanup those sessions which haven''t been modified in recent 5 > > > >> > minutes. How to make it a background process in my rails application? > > > > >> > thanks in advance, > > > > >> > xiahong >>