protected function getSessionSaveHandler(
        ServiceLocatorInterface $serviceLocator,
        $sessionConfig
    ) {
        if (!isset($sessionConfig['save_handler'])) {
            return null;
        }

        // Setting with invokable currently not implemented.  No session
        // Save handler available in ZF2 that's currently invokable is available
        // for testing.

        /** @var SaveHandlerInterface $sessionSaveHandler */
        $saveHandler = $serviceLocator->get($sessionConfig['save_handler']);

        if (!$saveHandler instanceof SaveHandlerInterface) {
            throw new InvalidArgumentException(
                'Session Save Handler class must implement '
                . 'Zend\Session\Storage\StorageInterface'
            );
        }

        return $saveHandler;
    }