Sessions things I can't figure out from the api

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,

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

Craig W. 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”?

On Sat, 2006-10-28 at 20:21 +0200, None None wrote:

Craig W. 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

On Sat, 2006-10-28 at 11:14 -0700, Craig W. wrote:

which works fine. Sessions are ActiveRecord if that matters.

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

On Sun, 2006-10-29 at 23:48 -0500, Long wrote:

end
So I added to the model, in_out.rb


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

Craig W. wrote:

end

: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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs