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...@gmail.com> wrote:
> sorry for confusion. for databased session
>
> 2009/6/25 Nicholas Henry <nicholas.he...@gmail.com>
>
>
>
>
>
> > yes to which one?
>
> > On Thu, Jun 25, 2009 at 3:08 PM, gaoxh gaoxh04<gaox...@gmail.com> wrote:
> > > yes..
>
> > > 2009/6/25, Nicholas Henry <nicholas.he...@gmail.com>:
>
> > >> 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...@gmail.com> 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@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to