1. Go to this page and download the library: Download horde/sessionhandler 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/ */
horde / sessionhandler example snippets
use Horde\SessionHandler\SessionHandler;
use Horde\SessionHandler\Storage\FileBackend;
$handler = new SessionHandler(
backend: new FileBackend('/var/sessions'),
);
// Create, read, write, done.
$session = $handler->create();
$session->set('user', 'alice');
$handler->save($session);
// Later...
$session = $handler->load($session->getId());
echo $session->get('user'); // alice
new FileBackend(string $path)
new SqlBackend(Horde\Db\Adapter $db, string $table = 'horde_sessionhandler')
new HashtableBackend(Horde_HashTable_Base & Horde_HashTable_Lock $ht, bool $track = false)
new StackBackend(SessionStorageBackend ...$backends) // last is master
new ExternalBackend(Closure $read, Closure $write, Closure $delete)
new BuiltinBackend(string $path = '')