Phalcon + Redis (save session)

How I can add Predis library ( to Phalcon application? I want to use a Redis server to store user sessions. I use this manual

I think what I need change session adapter on dependency injection

$di->set('session', function(){
    $session = new SessionAdapter();
    return $session;

How to make the most correct?


I use this code

$di->set('session', function(){
    //Registering Predis system

    $session = new RedisSessionHandler();
    return $session;

but when I'm trying to get the session:

$session = $di->getShared('session');
    $auth = $session->get('auth');
    $user = $session->get('user-data');

I get exception

Fatal error: Call to undefined method Academy\RedisSessionHandler::get() in G:\www\domains\localhost3\app\config\services.php on line 80


You're returning a RedisSessionHandler instance, but you must return an object compatible with Phalcon\Session\AdapterInterface as session service.