Sha256: db7292154bbdd4dc8078f938fada62d255f4b8e71b3ca485c24c97430633cda2

Contents?: true

Size: 613 Bytes

Versions: 12

Compression:

Stored size: 613 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # This controller allows the user to accept the cookie policy.
  class CookiePolicyController < Decidim::ApplicationController
    skip_before_action :store_current_location

    def accept
      response.set_cookie(
        Decidim.config.consent_cookie_name,
        value: "true",
        path: "/",
        httponly: true,
        secure: request.session_options[:secure],
        expires: 1.year.from_now.utc
      )

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
decidim-core-0.26.10 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.26.9 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.26.8 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.26.7 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.26.5 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.26.4 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.26.3 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.26.2 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.26.1 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.26.0 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.26.0.rc2 app/controllers/decidim/cookie_policy_controller.rb
decidim-core-0.26.0.rc1 app/controllers/decidim/cookie_policy_controller.rb