I am using the restful_authentication plugin for my login page. The problem is that after logging in as a user, I never log out until I log out. How to set a session timeout of 15 minutes? For example, after 15 minutes, if I go to any page, I should be redirected to the login page.
You can configure the session expiration time in the config / intializers / session_store.rb file in rails 2.3.
Just add the following parameter:
:expire_after => 60.minutes
/, before_filter:
request.session_options = request.session_options.dup request.session_options[:expire_after] = 5.minutes request.session_options.freeze
: http://squarewheel.pl/posts/3, rails < 2.3.
, cookie, ( , , rails < 2.3). , before_filter, , . , , >= 2.3
.rb:
before_filter :update_activity_time, :except => [:login, :logout] def update_activity_time session[:expires_at] = 60.minutes.from_now #default 60 end
Source: https://habr.com/ru/post/1709495/More articles:Using a pointer returned from a C library in C ++ - c ++SQL Join and Count can't GROUP BY right? - sqlHave you set up a company to sell apps on the App Store App Store? - iphoneWx.choice not working in ubuntu - wxpythonMS-SQL Server 2000 slow full-text indexing - sql-serverHow can I add text instead of replacing while searching and replacing with Perl? - regexCombining XML files with attributes - xmlHelp me get started with OpenGL - iphonePackaging script source files in IronPython and IronRuby - pythonhow to make iphone apps like ibeer, imilk, ibug, ibeer - iphoneAll Articles