dev-master
9999999-devSingleton for Session using ZLX Cache and ZLX Security
MIT
The Requires
by Alexandre de Freitas Caetano
v1.0.5
1.0.5.0Singleton for Session using ZLX Cache and ZLX Security
MIT
The Requires
by Alexandre de Freitas Caetano
Wallogit.com
2017 © Pedro Peláez
Singleton for Session using ZLX Cache and ZLX Security
Singleton for Session using ZLX Cache and ZLX Security, (*1)
In your composer.json file include:, (*2)
"require": {
"aledefreitas/zlx_session": "*"
}
Or you can require it with composer:, (*3)
composer require aledefreitas/zlx_session
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)
returns boolean, (*7)
Session::set('Test', [ 'key' => 'value' ]);
===============, (*8)
To retrieve data inside the Session, you can use Session::get(), (*9)
returns mixed, (*10)
Session::get('Test');
===============, (*11)
To get the current Session ID, you can use Session::getSessionId(), (*12)
returns string, (*13)
Session::getSessionId();
===============, (*14)
To destroy a Session, you can use Session::destroy(), (*15)
returns void, (*16)
Session::destroy();
Singleton for Session using ZLX Cache and ZLX Security
MIT
Singleton for Session using ZLX Cache and ZLX Security
MIT