PHP code example of dxw / session-handler-redis

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

    

dxw / session-handler-redis example snippets


   $client = new \Predis\Client([
     'scheme' => 'tcp',
     'host'   => 'redis',
     'port'   => 6379,
   ]);

   session_set_save_handler(new \SessionHandlerRedis\Handler($client));