Topic: Session timeout


I've looked through the code in my app, but can't see where the default session timeout is set - so I guess it's somewhere in Rails itself.  I've hunted through the online docs & Googled away merrily but couldn't anything.

I ask because I'm trying to get the cookies I create to allow phpBB integration to expire at roughly the same time as the RoR session, for consistency.

Can anyone point me at the appropriate docs?  TIA :-)

Duncan Bayne

Re: Session timeout

put these in your config/environment.rb and restart your server

# this changes the name of the cookie
ActionController::Base.session_options[:session_key] = "my_cool_cookie_session_id"
# this changes when the cookie, and thus the session, will expire
ActionController::Base.session_options[:session_expires] = Time.local(2029,"jan")

If you need more... … ml#M000101

Re: Session timeout

I think you have to be careful this way though, I experimented with this a bit and it seems that the session will expire at exactly that moment, even if the user is in the middle of doing something. Try setting the time to 10 seconds in the future and you will see what I mean. I think you would have to write some code to extend the expiration time every time the user performs an action.