public function createHandlerByConfig(): \SessionHandlerInterface
    {
        if (!isset($this->getConfig()['driver'])) {
            throw new \InvalidArgumentException('Session driver required');
        }
        $handler = $this->getHandler($this->getConfig()['driver']);
        $handler instanceof LifetimeInterface && $handler->setLifetime($this->getConfig()['lifetime']);
        return $handler;
    }