Skip to content

Commit 6c37efd

Browse files
committed
Skipping Setting of cookies except admin
1 parent 0766365 commit 6c37efd

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

evaluationserver/app/controllers/administration_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
class AdministrationController < ApplicationController
22

33
def admin_mode_on
4+
request.session_options[:skip] = false
45
session[:admin] = true
56
redirect_back(fallback_location: root_path)
67
end
78

89
def admin_mode_off
10+
request.session_options[:skip] = false
911
session.delete(:admin)
1012
redirect_back(fallback_location: root_path)
1113
end

evaluationserver/app/controllers/application_controller.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ class ApplicationController < ActionController::Base
22
# Prevent CSRF attacks by raising an exception.
33
# For APIs, you may want to use :null_session instead.
44
protect_from_forgery with: :exception
5-
5+
66
before_action :set_cache_headers
77

88
CREDENTIALS = {
@@ -47,6 +47,7 @@ def set_cache_headers
4747
response.headers["Cache-Control"] = "no-cache, no-store"
4848
response.headers["Pragma"] = "no-cache"
4949
response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
50+
request.session_options[:skip] = true
5051
end
5152

5253
end

0 commit comments

Comments
 (0)