2017 © Pedro Peláez
 

library cookie-encryption

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

image

ellipse/cookie-encryption

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

  • Monday, February 5, 2018
  • by pmall
  • Repository
  • 1 Watchers
  • 0 Stars
  • 26 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 4 % Grown

The README.md

Cookie encryption

This package provides a Psr-15 middleware allowing to encrypt cookies using defuse/php-encryption., (*1)

Require php >= 7.3, (*2)

Installation composer require ellipse/cookie-encryption, (*3)

Run tests ./vendor/bin/kahlan, (*4)

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., (*5)

<?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']);

The Versions

05/02 2018

dev-master

9999999-dev https://github.com/ellipsephp/cookie-encryption

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

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar pmall

middleware psr-7 cookie encryption psr-15

23/01 2018

1.0.1

1.0.1.0 https://github.com/ellipsephp/cookie-encryption

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

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar pmall

middleware psr-7 cookie encryption psr-15

19/11 2017