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 ```php $di->set('session', function(){ $session = new SessionAdapter(); $session->start(); return $session; }); ``` How to make the most correct?


I use this code ```php $di->set('session', function(){ require(APP_PATH."/library/Predis/Autoloader.php"); //Registering Predis system Predis\Autoloader::register();

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

}); ``` but when I'm trying to get the session: ```php $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.