Hi, this blog is no longer maintained, my new blog is here

Ruby On Rails and a Conning Israeli entrepreneur

Rails Plugin: Dynamic Session Expiry

With session_lifetime you can set after how much time of inactivity your session should expire, you can execute an action when the session expires, and you can set where to redirect_to after session expiry.
Example


class ApplicationController << ActionController::Base
expires_session :time => 2.hours, :redirect_to => '/login'

protected
def on_expiry
flash[:notice] = "Your session has been expired, and you have been logged out."
end
end


Get it from

git://github.com/DefV/session_lifetime.git

0 comments:


The Web Ask eizesus.com

Subscribe

    follow me on Twitter

    Twiters Around

    About Me

    My photo
    I am a web developer for more than 9 years, managed, cried, coded, designed and made money in this industry. now trying to do it again.

    Labels