I''m trying to grok the session configuration settings for rails. I''d like to have sessions that time out in 30 minutes, requiring re-login after that much time of inactivity. I''ve read the howto for changing session options, but my dispatch.cgi doesn''t have the line making a new Dispatcher (instead it''s calling the dispatch method of Dispatcher). I tried passing options to the dispatch call like so (I got the settings other than session_expires from dispatcher.rb): ADDITIONAL_LOAD_PATHS.each { |dir| $:.unshift "#{File.dirname(__FILE__)}/../#{dir}" } Dispatcher.dispatch(:session_options => { "database_manager" => CGI::Session::PStore, "prefix" => "ruby_sess.", "session_path" => "/", ''session_expires'' => Time.now + 30 * 60 # 30 minute timeout }) That doesn''t work. I''m a nuby, so I appreciate any help. :) --Scott
On Wed, Oct 20, 2004 at 02:05:56PM -0700, Scott Hill wrote:> I''m trying to grok the session configuration settings for rails. I''d > like to have sessions that time out in 30 minutes, requiring re-login > after that much time of inactivity. > > I''ve read the howto for changing session options, but my dispatch.cgi > doesn''t have the line making a new Dispatcher (instead it''s calling > the dispatch method of Dispatcher). I tried passing options to the > dispatch call like so (I got the settings other than session_expires > from dispatcher.rb): > > ADDITIONAL_LOAD_PATHS.each { |dir| $:.unshift > "#{File.dirname(__FILE__)}/../#{dir}" } > Dispatcher.dispatch(:session_options => { > "database_manager" => CGI::Session::PStore, > "prefix" => "ruby_sess.", > "session_path" => "/", > ''session_expires'' => Time.now + 30 * 60 # 30 minute timeout > }) > > That doesn''t work. I''m a nuby, so I appreciate any help. :) > > --ScottLooking at one of my files I do: session_options = { ... } Dispatcher.dispatch(CGI.new, session_options) Seems to work for me. -Scott
Thanks, I''ll give that a shot. --Scott On Wed, 20 Oct 2004 21:57:41 -0400, Scott Barron <scott-HDQKq3lYuGDk1uMJSBkQmQ@public.gmane.org> wrote:> On Wed, Oct 20, 2004 at 02:05:56PM -0700, Scott Hill wrote: > > > > I''m trying to grok the session configuration settings for rails. I''d > > like to have sessions that time out in 30 minutes, requiring re-login > > after that much time of inactivity. > > > > I''ve read the howto for changing session options, but my dispatch.cgi > > doesn''t have the line making a new Dispatcher (instead it''s calling > > the dispatch method of Dispatcher). I tried passing options to the > > dispatch call like so (I got the settings other than session_expires > > from dispatcher.rb): > > > > ADDITIONAL_LOAD_PATHS.each { |dir| $:.unshift > > "#{File.dirname(__FILE__)}/../#{dir}" } > > Dispatcher.dispatch(:session_options => { > > "database_manager" => CGI::Session::PStore, > > "prefix" => "ruby_sess.", > > "session_path" => "/", > > ''session_expires'' => Time.now + 30 * 60 # 30 minute timeout > > }) > > > > That doesn''t work. I''m a nuby, so I appreciate any help. :) > > > > --Scott > > Looking at one of my files I do: > > session_options = { ... } > Dispatcher.dispatch(CGI.new, session_options) > > Seems to work for me. > > -Scott > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- --Scott