00f100 / fcphp-cookie
There is no license information available for the latest version (0.1.2) of this package.
Package to manipulate Cookies
0.1.2
2018-08-04 15:46 UTC
Requires
- php: >=7.2
- 00f100/array_dot: 0.*
- 00f100/fcphp-crypto: 0.*
Requires (Dev)
- 00f100/phpdbug: *
- phpunit/phpunit: 6.*
This package is auto-updated.
Last update: 2026-02-18 09:11:52 UTC
README
Package to manipulate Cookie
How to install
Composer:
$ composer require 00f100/fcphp-cookie
or add in composer.json
{
"require": {
"00f100/fcphp-cookie": "*"
}
}
How to use
use FcPhp\Cookie\Facades\CookieFacade; /** * Facade to return instance of Cookie * * @param string $key Key into $_COOKIE of Cookie * @param array $cookies Variable $_SESSION * @param string $nonce Nonce to Crypto * @param string $pathKeys Path to save keys of Crypto * @param string $forceNewInstance Force create new instance * @return FcPhp\Cookie\Interfaces\ICookie */ CookieFacade::getInstance(string $key, array $cookies, string $nonce = null, string $pathKeys = null, bool $forceNewInstance = false) :ICookie // With No Crypto into content $cookie = CookieFacade::getInstance('key-cookie', $_COOKIE); // With Crypto into content use FcPhp\Crypto\Crypto; $nonce = Crypto::getNonce(); $cookie = CookieFacade::getInstance('key-cookie', $_COOKIE, $nonce); // Create new configuration $cookie->set('item.config', 'value'); // Print: value echo $cookie->get('item.config');