projects
/
rails.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
57ba7d6
)
Change session expiry to 28 days when "remember me" is set
author
Tom Hughes
<tom@compton.nu>
Thu, 23 Feb 2012 11:26:02 +0000
(11:26 +0000)
committer
Tom 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
patch
|
blob
|
history
diff --git
a/app/controllers/user_controller.rb
b/app/controllers/user_controller.rb
index 7b3b596df2b5f60957989b3816ae53470ccf6241..5c11a5c75b3cdea41dd0a37a9926cf70d4179473 100644
(file)
--- a/
app/controllers/user_controller.rb
+++ b/
app/controllers/user_controller.rb
@@
-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)