1. Go to this page and download the library: Download evolutionphp/session library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
evolutionphp / session example snippets
$config = [
'name' => 'PHPSESSID', //Session Name
'save_path' => __DIR__.'/session_directory'
];
$session = new \EvolutionPHP\Session\Session();
$session->start($config);
$session = new \EvolutionPHP\Session\Session();
$session->start();
//Set
$session->set('user','root');
//Check if session exists
if($session->has('user')){
echo 'Session exists';
}
//Unset
$session->remove('user');
//Unset all sessions
$session->clear();
//Destroy
$session->destroy();
$session = new \EvolutionPHP\Session\Session();
$session->start();
//Set
$session->setFlash('user', 'root');
//Check if session exists
if($session->hasFlash('user')){
echo 'Session exists';
}
//Check if session exists and remove it immediately
if($session->hasFlash('user', true)){
echo 'Session exists';
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.