rosio/encrypted-cookie
Composer 安装命令:
composer require rosio/encrypted-cookie
包简介
Allows easy management of encrypted cookies
README 文档
README
Library provides basic functionality to easily create and manage encrypted cookies.
Based off of RFC 6896 KoanLogic's Secure Cookie Sessions for HTTP.
Testing
To run unit tests:
composer installvendor/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); $storage->save($cookie); // Load the cookie $newCookie = $storage->load('testCookie'); // Returns a PartialCookie echo $newCookie->getData();
统计信息
- 总下载量: 6.65k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-02-24