Merge pull request #4226 from xfalcox/non-persistent-session

FEATURE: add setting permanent_session_cookie to configure session st…
This commit is contained in:
Sam
2016-06-29 16:47:31 +10:00
committed by GitHub
3 changed files with 7 additions and 1 deletions

View File

@ -66,7 +66,11 @@ class Auth::DefaultCurrentUserProvider
user.auth_token = SecureRandom.hex(16)
user.save!
end
cookies.permanent[TOKEN_COOKIE] = { value: user.auth_token, httponly: true }
if SiteSetting.permanent_session_cookie
cookies.permanent[TOKEN_COOKIE] = { value: user.auth_token, httponly: true }
else
cookies[TOKEN_COOKIE] = { value: user.auth_token, httponly: true }
end
make_developer_admin(user)
enable_bootstrap_mode(user)
@env[CURRENT_USER_KEY] = user