Hi all, Iam having a requirement where a user who has logged in to my site is idle for 5 minutes, then they should automatically redirect back to login page. Im using devise. But its timeoutable is not working. I also looked at using session in config. It also dint help. Please anyone help me in this. -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi Angel, Devise will expire session in the time that you put in ''config/initializers/devise.rb'' with config.timeout_in = 5.minutes but this won''t redirect your app automatically to the login page, so, you would need some javascript function to solve this. You should try to implement some like an automatic redirection after expire some time (minutes, hours, etc) Here there is some that helped me to solve a task similar as yours. http://philpalmieri.com/2009/09/jquery-session-auto-timeout-with-prompt/ I hope this helps. See ya. Cesar ------------------------------------------------- In: http://www.linkedin.com/in/cesardiaz -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Fri, Dec 30, 2011 at 7:40 AM, César <cesare.diaz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Devise will expire session in the time that you put in > ''config/initializers/devise.rb'' with > > config.timeout_in = 5.minutes > > but this won''t redirect your app automatically to the login page, so, > you would need some javascript function to solve this.Alternatively, just include a meta-refresh tag in every page pointing to your login page, with the appropriate timeout as the refresh interval. -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder twitter: @hassan -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hassan Schroeder wrote in post #1038883:> On Fri, Dec 30, 2011 at 7:40 AM, Csar <cesare.diaz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> Devise will expire session in the time that you put in >> ''config/initializers/devise.rb'' with >> >> config.timeout_in = 5.minutes >> >> but this won''t redirect your app automatically to the login page, so, >> you would need some javascript function to solve this. > > Alternatively, just include a meta-refresh tag in every page pointing to > your login page, with the appropriate timeout as the refresh interval.I would also advise planning ahead to remove this "feature" when your client begs you to, since the users will all hate it. -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 30 Dec 2011, at 19:54, Robert Walker wrote:>>> Devise will expire session in the time that you put in >>> ''config/initializers/devise.rb'' with >>> >>> config.timeout_in = 5.minutes >>> >>> but this won''t redirect your app automatically to the login page, >>> so, >>> you would need some javascript function to solve this. >> >> Alternatively, just include a meta-refresh tag in every page >> pointing to >> your login page, with the appropriate timeout as the refresh >> interval. > > I would also advise planning ahead to remove this "feature" when your > client begs you to, since the users will all hate it.So true. We were asked this question for some freelance work a few years back, in fact, they insisted on having that "feature" for security reasons. It took them exactly one week to beg us to take it away again. 5 minutes pass so quickly: you have a phone call, you get a coffee and bump into a colleague, … Best regards Peter De Berdt -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Fri, Dec 30, 2011 at 11:46 AM, Peter De Berdt <peter.de.berdt-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote:>> I would also advise planning ahead to remove this "feature" when your >> client begs you to, since the users will all hate it. > > So true. We were asked this question for some freelance work a few years > back, in fact, they insisted on having that "feature" for security reasons. > It took them exactly one week to beg us to take it away again. 5 minutes > pass so quickly: you have a phone call, you get a coffee and bump into a > colleague, …But the "how to" remains a valid question, regardless of whether it''s 5 minutes, 30 minutes or 24 hours :-) -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder twitter: @hassan -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.