1. Go to this page and download the library: Download juliangut/sessionware library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
juliangut / sessionware example snippets
\Jgut\Middleware\Session::regenerateSessionId();
use \Jgut\Middleware\SessionWare
$configuration = [
'name' => 'myProjectSessionName',
'lifetime' => 1800, // 30 minutes
];
$sessionMiddleware = new SessionWare($configuration);
// Get $request and $response from PSR7 implementation
$request = new Request();
$response = new Response();
$response = $sessionMiddleware($request, $response, function(){ });
// Session is started, populated with default parameters and response has session cookie header