I’m having an issue with Rails version 3.0.9 and trying to get
persistent cookies to stay for the existing session. I want a 1 year
expire on all sessions as a default.
my Curent User is defined in application controller as:
def current_user @current_user ||= User.find_by_id(session[:user_id])
end
I have checked my site in firefox using firecookie and it shows the
cookie as session only and after I close the browser and reopen the
browser, I have to log in again.
And, after logging into IE and into Firefox, the sessions hold after the
browser is closed. I looked at the cookies with Firecookie and saw the
following:
_my_key Expires: Timestamp with 2 hours later
So, the expire_after works fine with Rails 3.0.10 which is what I’m
using now. I just have to create a sweep routine to clean up the
database when necessary;
(per ruby on rails guides - section 2.9 session expiry)
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.