PHP code example of linkorb / flex-session

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

    

linkorb / flex-session example snippets


$typeProvider = TypeProviderFactory::fromEnv('FLEX_SESSION');
$handlerFactory = new FlexSessionHandlerFactory($typeProvider);

$handlerFactory->addType('file', new FileSessionHandlerFactory());
$handlerFactory->addType('memcached', new MemcachedSessionHandlerFactory());
$handlerFactory->addType('pdo', new PdoSessionHandlerFactory());

$handler = new FlexSessionHandler($handlerFactory);
$session = new Session(new NativeSessionStorage([], $handler));

./vendor/bin/phpunit --bootstrap vendor/autoload.php tests/