]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4487 the "remember me" cookie must also be flagged HttpOnly
authorSimon Brandhof <simon.brandhof@gmail.com>
Wed, 14 Aug 2013 15:27:45 +0000 (17:27 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Wed, 14 Aug 2013 15:27:56 +0000 (17:27 +0200)
sonar-server/src/main/webapp/WEB-INF/app/controllers/sessions_controller.rb
sonar-server/src/main/webapp/WEB-INF/lib/authenticated_system.rb

index 49979d701cf635cf9d745c12becd22b3e0ec1908..36c69d5ed1ba5927a2abdf28b217b440fe51eb23 100644 (file)
@@ -31,7 +31,7 @@ class SessionsController < ApplicationController
     if logged_in?
       if params[:remember_me] == '1'
         self.current_user.remember_me
-        cookies[:auth_token] = { :value => self.current_user.remember_token , :expires => self.current_user.remember_token_expires_at }
+        cookies[:auth_token] = { :value => self.current_user.remember_token , :expires => self.current_user.remember_token_expires_at, :http_only => true }
       end
       redirect_back_or_default(home_url)
     else
index 140b12ea41a674c16883d228209826418c972527..5f6f661a660bf9556aa02b7c7298a27e5e95298b 100644 (file)
@@ -197,7 +197,8 @@ module AuthenticatedSystem
   def send_remember_cookie!
     cookies[:auth_token] = {
       :value   => @current_user.remember_token,
-      :expires => @current_user.remember_token_expires_at }
+      :expires => @current_user.remember_token_expires_at,
+      :http_only => true }
   end
 
 end