Allows easy management of encrypted cookies

Installs: 979

Dependents: 0

Stars: 5

Watchers: 2

Open Issues: 1

v1.0.0 2014-03-03 23:01 UTC


Build Status

Library provides basic functionality to easily create and manage encrypted cookies.

Based off of RFC 6896 KoanLogic's Secure Cookie Sessions for HTTP.


To run unit tests:

  1. composer install
  2. vendor/bin/phpunit

Quick Example

use Rosio\EncryptedCookie\CookieStorage;
use Rosio\EncryptedCookie\Cookie;
use Rosio\EncryptedCookie\CryptoSystem\AES_SHA;

// Used to create cookies with a given cryptoSystem
$storage = new CookieStorage(new AES_SHA('32charactercryptokeymustbe32chrs', 'HMACKey'));

// Create a cookie
$data = 'blah';
$cookie = Cookie::create('testCookie', $data);

// Load the cookie
$newCookie = $storage->load('testCookie'); // Returns a PartialCookie
echo $newCookie->getData();