PHP code example of uma / redis-session-handler

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

    

uma / redis-session-handler example snippets


// top of my-project/web/app.php

A\RedisSessionHandler(), true);



// a script that returns the total number of
// requests made during a given session's lifecycle.

session_start();

if (!isset($_SESSION['visits'])) {
  $_SESSION['visits'] = 0;
}

$_SESSION['visits']++;

echo $_SESSION['visits'];

// session_set_save_handler(new \UMA\RedisSessionHandler(), true);