Class: Decidim::CookiePolicyController

Inherits:
ApplicationController show all
Defined in:
app/controllers/decidim/cookie_policy_controller.rb

Overview

This controller allows the user to accept the cookie policy.

Instance Method Summary collapse

Methods included from UserBlockedChecker

#check_user_block_status, #check_user_not_blocked

Methods included from NeedsSnippets

#snippets

Methods included from HttpCachingDisabler

#disable_http_caching

Methods included from HasStoredPath

#skip_store_location?, #store_current_location

Methods included from RegistersPermissions

register_permissions

Methods included from NeedsOrganization

enhance_controller, extended, included

Instance Method Details

#acceptObject



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/decidim/cookie_policy_controller.rb', line 8

def accept
  response.set_cookie(
    Decidim.config.consent_cookie_name,
    value: "true",
    path: "/",
    expires: 1.year.from_now.utc
  )

  respond_to do |format|
    format.js
    format.html { redirect_back fallback_location: root_path }
  end
end