PHP code example of temant / session-manager

1. Go to this page and download the library: Download temant/session-manager 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/ */

    

temant / session-manager example snippets




use Temant\SessionManager\Session;

$session = new Session();

$session->start();

$session->set('user_id', 123);

$userID = $session->get('user_id');

if ($session->has('user_id')) {
    // Do something
}

$session->remove('user_id');

$session->regenerate();

$session->destroy();