Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/00f100/fcphp-session
Package to manipulate Session
https://github.com/00f100/fcphp-session
fcphp fcphp-session php7 php72 session
Last synced: 2 days ago
JSON representation
Package to manipulate Session
- Host: GitHub
- URL: https://github.com/00f100/fcphp-session
- Owner: 00F100
- License: mit
- Created: 2018-06-30T21:17:03.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-04T15:59:49.000Z (over 6 years ago)
- Last Synced: 2024-12-19T05:36:47.133Z (about 1 month ago)
- Topics: fcphp, fcphp-session, php7, php72, session
- Language: PHP
- Size: 19.5 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FcPhp Session
Package to manipulate Session
[![Build Status](https://travis-ci.org/00F100/fcphp-session.svg?branch=master)](https://travis-ci.org/00F100/fcphp-session) [![codecov](https://codecov.io/gh/00F100/fcphp-session/branch/master/graph/badge.svg)](https://codecov.io/gh/00F100/fcphp-session) [![Total Downloads](https://poser.pugx.org/00F100/fcphp-session/downloads)](https://packagist.org/packages/00F100/fcphp-session)
## How to install
Composer:
```sh
$ composer require 00f100/fcphp-session
```or add in composer.json
```json
{
"require": {
"00f100/fcphp-session": "*"
}
}
```## How to use
```php
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();
```