duration of session

Hi everyone,

how to set the duration of a session? Does "ActionController::Base.session_options[:new_session] = ... " work? Another question is if i am using database for session storage, when a session expires, will rails automatically remove the session record from database for me?

thanks in advance, xiahong

Nope. sessions never expire in that sense: the cookie containing the session id will die when the user exits their browser but your app does not (and in general cannot) know about that. It's up to you to periodically clean out old rows from the sessions table.

Fred

Assume session is deleted before the cookie holding its id expires, what happens when client contacts server with this session id? does rails allocate a new session with a different ID to replace this old session?