Monday, December 13, 2010

session expiry on timeout

give this in application controller.


MAX_SESSION_PERIOD = 3600

before_filter :session_expiry

def session_expiry
reset_session if session[:expiry_time] and session[:expiry_time] < Time.now

session[:expiry_time] = MAX_SESSION_PERIOD.seconds.from_now
return true
end



http://snippets.dzone.com/posts/show/7400
http://www.quarkruby.com/2007/9/20/ruby-on-rails-security-guide#sqlinjection

No comments:

Post a Comment