atlasconsulting/cakephp-cookie-consent 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

atlasconsulting/cakephp-cookie-consent

Composer 安装命令:

composer require atlasconsulting/cakephp-cookie-consent

包简介

CookieConsent plugin for CakePHP

README 文档

README

php image image

This plugin helps to remove cookies your app set and on which a user didn't consent. It works reading a configurable cookie that contain information about the categories of cookie accepted by the user. It works out of the box with Cookie Consent.

Installation

You can install this plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

composer require atlasconsulting/cakephp-cookie-consent

Usage

Add the CookieCosentMiddleware to the application middleware queue.

public function middleware(MiddlewareQueue $middlewareQueue): MiddlewareQueue
{
    return $middlewareQueue
        // Catch any exceptions in the lower layers,
        // and make an error page/response
        ->add(new ErrorHandlerMiddleware(Configure::read('Error')))

        ->add(new CookieConsentMiddleware([
            'remove' => [
                'preferences' => ['lang'], // remove `lang` cookie if `preferences` category isn't accepted
                'analytics' => ['my_analytics'], // remove `my_analytics` cookie if `analytics` category isn't accepted
            ],
        ]));

        // other middlewares here
}

Configuration

The middleware is configurable with:

[
    'cookieName' => 'cc_cookie',
    'searchIn' => 'level',
    'remove' => [
        'preferences' => [],
        'analytics' => [],
        'targeting' => [],
    ],
]

where

  • cookieName (default cc_cookie), the cookie consent to analyze
  • searchIn (default level), the key to look for in the json string value of cookie. The value must be an array of cookies' categories accepted by the user, for example ['preferences', 'analytics'].
  • remove an array divided by cookie categories that are to remove if not accepted

统计信息

  • 总下载量: 363
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 9
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-05-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固