I have a cron script that destroys sessions that are over 30 minutes, essentially running from library... class SessionCleaner def self.remove_stale_sessions CGI::Session::ActiveRecordStore::Session Session.destroy_all( [''updated_at < ?'', 30.minutes.ago] ) end end which works fine. Sessions are ActiveRecord if that matters. I have on my layout for this one particular model/controller, <meta http-equiv="refresh" content="300"> which refreshes the screen every 5 minutes which means as long as they leave this screen open, their session is updated and never destroyed. So I added to the model, in_out.rb :session :on, :except => %w(list) and restarted the server but still, when this page is refreshed, so is the user''s session. Is it possible to have a page set so that if it is refreshed, the session remains untouched? Craig --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Craig White wrote:> Is it possible to have a page set so that if it is refreshed, the > session remains untouched?would that make any sense? why "refresh" if you don''t want to mark the user''s session as "still active"? -- 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-/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 -~----------~----~----~----~------~----~------~--~---
On Sat, 2006-10-28 at 20:21 +0200, None None wrote:> Craig White wrote: > > Is it possible to have a page set so that if it is refreshed, the > > session remains untouched? > > would that make any sense? why "refresh" if you don''t want to mark the > user''s session as "still active"?---- In this case, it is an ''In Out'' board which lists the employees and whether they are in or out which is handy for a receptionist. But the receptionist also walks away from her desk and I would like this screen to refresh more frequently but not allow someone else to sit down with the receptionist''s authentication and access other areas. Future plans are to: - expire sessions more frequently - not require a login for the list view at all Craig --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Sat, 2006-10-28 at 11:14 -0700, Craig White wrote:> I have a cron script that destroys sessions that are over 30 minutes, > essentially running from library... > > class SessionCleaner > def self.remove_stale_sessions > CGI::Session::ActiveRecordStore::Session > Session.destroy_all( [''updated_at < ?'', 30.minutes.ago] ) > end > end > > which works fine. Sessions are ActiveRecord if that matters. > > I have on my layout for this one particular model/controller, > <meta http-equiv="refresh" content="300"> > > which refreshes the screen every 5 minutes which means as long as they > leave this screen open, their session is updated and never destroyed. > > So I added to the model, in_out.rb > > :session :on, :except => %w(list) > > and restarted the server but still, when this page is refreshed, so is > the user''s session. > > Is it possible to have a page set so that if it is refreshed, the > session remains untouched?---- even with ''session :off'' in my in_out.rb model, a refresh of my list view of this model still updates the session. ;-( Anyone? Craig --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Craig White wrote:> > On Sat, 2006-10-28 at 11:14 -0700, Craig White wrote: > > I have a cron script that destroys sessions that are over 30 minutes, > > essentially running from library... > > > > class SessionCleaner > > def self.remove_stale_sessions > > CGI::Session::ActiveRecordStore::Session > > Session.destroy_all( [''updated_at < ?'', 30.minutes.ago] ) > > end > > end > > > > which works fine. Sessions are ActiveRecord if that matters. > > > > I have on my layout for this one particular model/controller, > > <meta http-equiv="refresh" content="300"> > > > > which refreshes the screen every 5 minutes which means as long as they > > leave this screen open, their session is updated and never destroyed. > > > > So I added to the model, in_out.rb > > > > :session :on, :except => %w(list) > >Have you tried to use the above line in your controller?> > and restarted the server but still, when this page is refreshed, so is > > the user''s session. > > > > Is it possible to have a page set so that if it is refreshed, the > > session remains untouched? > ---- > even with ''session :off'' in my in_out.rb model, a refresh of my list > view of this model still updates the session. >Again try in your controller... HTH, Long www.edgesoft.ca --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Sun, 2006-10-29 at 23:48 -0500, Long wrote:> Craig White wrote: > > > > On Sat, 2006-10-28 at 11:14 -0700, Craig White wrote: > > > I have a cron script that destroys sessions that are over 30 minutes, > > > essentially running from library... > > > > > > class SessionCleaner > > > def self.remove_stale_sessions > > > CGI::Session::ActiveRecordStore::Session > > > Session.destroy_all( [''updated_at < ?'', 30.minutes.ago] ) > > > end > > > end > > > > > > which works fine. Sessions are ActiveRecord if that matters. > > > > > > I have on my layout for this one particular model/controller, > > > <meta http-equiv="refresh" content="300"> > > > > > > which refreshes the screen every 5 minutes which means as long as they > > > leave this screen open, their session is updated and never destroyed. > > > > > > So I added to the model, in_out.rb > > > > > > :session :on, :except => %w(list) > > > > Have you tried to use the above line in your controller? > > > > and restarted the server but still, when this page is refreshed, so is > > > the user''s session. > > > > > > Is it possible to have a page set so that if it is refreshed, the > > > session remains untouched? > > ---- > > even with ''session :off'' in my in_out.rb model, a refresh of my list > > view of this model still updates the session. > > > Again try in your controller...---- I started in the controller, moved it to the model and sort of stayed with the model. Anyway, moving it from model in_out.rb to in_outs_controller.rb made no difference...a page refresh still updates the ActiveRecord session (Yes, I restarted the web server, logged out, deleted all sessions so I know this was a new, untainted session). ;-( Craig --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---