]> git.openstreetmap.org Git - rails.git/commitdiff
Change session expiry to 28 days when "remember me" is set
authorTom Hughes <tom@compton.nu>
Thu, 23 Feb 2012 11:26:02 +0000 (11:26 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 27 Feb 2012 09:01:48 +0000 (09:01 +0000)
The expiry is passed directly to memcache, which treats any value
over 30 days as an absolute time, so using 1 month leads to sessions
expiring as soon as they are created.

app/controllers/user_controller.rb

index 7b3b596df2b5f60957989b3816ae53470ccf6241..5c11a5c75b3cdea41dd0a37a9926cf70d4179473 100644 (file)
@@ -624,7 +624,7 @@ private
     cookies.permanent["_osm_username"] = user.display_name
 
     session[:user] = user.id
-    session_expires_after 1.month if session[:remember_me]
+    session_expires_after 28.days if session[:remember_me]
 
     target = session[:referer] || url_for(:controller => :site, :action => :index)