00f100 / fcphp-session
Package to manipulate Sessions
Installs: 158
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 1
Open Issues: 0
Type:package
Requires
- php: >=7.2
- 00f100/array_dot: 0.*
- 00f100/fcphp-cache: 0.*
- 00f100/fcphp-cookie: 0.*
Requires (Dev)
- 00f100/phpdbug: *
- phpunit/phpunit: 6.*
This package is auto-updated.
Last update: 2024-11-18 06:02:37 UTC
README
Package to manipulate Session
How to install
Composer:
$ composer require 00f100/fcphp-session
or add in composer.json
{ "require": { "00f100/fcphp-session": "*" } }
How to use
use FcPhp\Session\Facades\SessionFacade; /** * Method to return instance of Session * * @param array $cookies Cookies default * @param string $nonce Nonce to use 00f100/fcphp-crypto * @param string $pathKeys Path to save crypto-keys * @return void */ SessionFacade::getInstance(array $cookies, string $nonce = null, string $pathKeys = null); // Start session and load cache $nonce = '...'; $pathKeys = 'var/crypto/keys'; // Use Cache into file $sessionFile = SessionFacade::getInstance($_COOKIE, $nonce, $pathKeys); // Create new configuration $sessionRedis->set('item.config', 'value'); // Print: value echo $sessionRedis->get('item.config'); /* Return: Array ( 'item' => Array( 'config' => 'value' ) ) */ print_r($sessionRedis->get()); // Save into Cookie $sessionRedis->commit();