定制 ellipse/cookie-encryption 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

ellipse/cookie-encryption

Composer 安装命令:

composer require ellipse/cookie-encryption

包简介

Psr-15 middleware allowing to encrypt cookies using defuse/php-encryption

README 文档

README

This package provides a Psr-15 middleware allowing to encrypt cookies using defuse/php-encryption.

Require php >= 7.3

Installation composer require ellipse/cookie-encryption

Run tests ./vendor/bin/kahlan

Getting started

This middleware takes an instance of Defuse\Crypto\Key from the defuse/php-encryption package and an array of bypassed cookie names as parameters. It will use defuse encryption mechanism to decrypt the cookies attached to the Psr-7 request and encrypt the cookies attached to the Psr-7 response. The cookies with a name in the bypassed array will stay untouched. When the decryption fails for one cookie, its value is set as an empty string.

<?php

namespace App;

use Defuse\Crypto\Key;
use Ellipse\Cookies\EncryptCookiesMiddleware;

// Load an encryption key from your config.
$key = Key::loadFromAsciiSafeString(getenv('APP_KEY'));

// By using this middleware all cookies will be decrypted/encrypted, except the one named 'bypassed'.
$middleware = new EncryptCookiesMiddleware($key, ['bypassed']);

统计信息

  • 总下载量: 24.81k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-11-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固