Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

00f100/fcphp-cookie

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

00f100/fcphp-cookie

Package to manipulate Cookies

Source
Packagist
Version
0.1.2
Version published
Maintainers
1
Created
Source

Package to manipulate Cookie

Build Status codecov Total Downloads

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

FAQs

Package last updated on 04 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts