Hi,
Use the "session-timeout" plugin.
http://github.com/lukeredpath/session-timeout/
Example:
session_times_out_in 15.minutes, :after_timeout => :do_something
Good luck.
*Johalf Farina*
+55 (51)8487 1402
Twitter <http://twitter.com/johalf>
Working with
Rails<http://www.workingwithrails.com/person/15914-johalf-farina>
www.fande.com.br <http://fande.com.br>
On Tue, Oct 13, 2009 at 6:22 PM, RubyonRails_newbie <
craigwesty79-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:
>
> Hi There,
>
> Im going through the ruby on rails tutorial ''Railsspace''
at the
> moment.
>
> There is a :remember_me function that allows a cookie to be set at
> login to remember the user. See below:
>
>
> if @user.remember_me == "1"
> cookies[:remember_me] = { :value => "cookie name",
> :expires => 2.minutes.from_now }
> user.authorization_token = Digest::SHA1.hexdigest(
> "#{user.username}:
> #{user.password}")
>
> user.save!
> cookies[:authorization_token] = {
> :value => user.authorization_token,
> :expires => 2.minutes.from_now }
> else
> cookies.delete(:remember_me)
> cookies.delete(:authorization_token)
>
> When i look in safari''s preferences, I can see that the cookie is
set.
> Agfter the 2 mins, I refresh the web page, and....
>
> - Safari removes the cookies, but the user still looks logged in.
>
> Is there a way to amend this to ensure that say, after 15 mins, the
> user is automatically logged out.
>
> Can anyone help?
>
> Many Thanks
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---