2017 © Pedro Peláez
 

library zlx_session

Singleton for Session using ZLX Cache and ZLX Security

image

aledefreitas/zlx_session

Singleton for Session using ZLX Cache and ZLX Security

  • Friday, November 10, 2017
  • by aledefreitas
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 100 % Grown

The README.md

# ZLX Session

Singleton for Session using ZLX Cache and ZLX Security, (*1)

Installation

In your composer.json file include:, (*2)

"require": {
    "aledefreitas/zlx_session": "*"
}

Or you can require it with composer:, (*3)

composer require aledefreitas/zlx_session

Requirements

  • PHP 7.x +

Usage

In your bootstrap file, start the static class with:, (*4)

Session::init([
    'cache_instance' => 'default', // Which instance to use based on ZLX Cache configuration (OPTIONAL, defaults to 'default')
    'cookie_name' => 'ZLX_sess', // Which cookie name to use to store session id (OPTIONAL, defaults to 'ZLX_sess')
    'session_scret' => 'wxLl88ISVTz7lvHgZvOSKrxOWI7MjLA1', // Secret used to encrypt and decrypt with ZLX Security (OPTIONAL, defaults to '')
    'security_salt' => 'bhY4dZ5bEeru9e1XlObtY9Mc95cfDcrQ' // SALT used in ZLX Security for this session (OPTIONAL, defaults to null)
])

===============, (*5)

To save data into the Session, you can use Session::set(), (*6)

set(string $key, mixed $value)

returns boolean, (*7)

Session::set('Test', [ 'key' => 'value' ]);

===============, (*8)

To retrieve data inside the Session, you can use Session::get(), (*9)

get(string $key)

returns mixed, (*10)

Session::get('Test');

===============, (*11)

To get the current Session ID, you can use Session::getSessionId(), (*12)

getSessionId()

returns string, (*13)

Session::getSessionId();

===============, (*14)

To destroy a Session, you can use Session::destroy(), (*15)

destroy()

returns void, (*16)

Session::destroy();

The Versions

10/11 2017

dev-master

9999999-dev

Singleton for Session using ZLX Cache and ZLX Security

  Sources   Download

MIT

The Requires

 

by Alexandre de Freitas Caetano

10/11 2017

v1.0.5

1.0.5.0

Singleton for Session using ZLX Cache and ZLX Security

  Sources   Download

MIT

The Requires

 

by Alexandre de Freitas Caetano