PHP code example of gabbro-php / session

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

    

gabbro-php / session example snippets


use gabbro\auth\FileSessionRegistry;

// Create a file-backed session
$session = new FileSessionRegistry();

// Set some data
$session->set("user_id", 123);

// Retrieve data
$userId = $session->get("user_id");

// Save to storage
$session->save();