public function setHandler($handler, $config = array())
    {
        if (!($handler instanceof UserSessionHandlerInterface))
        {
            if (is_string($handler) && strpos($handler, '.') === false)
            {
                $identifier = $this->getIdentifier()->toArray();
                $identifier['path'] = array('session', 'handler');
                $identifier['name'] = $handler;
                // reset the handler
                $handler = $identifier;
            }

            $identifier = $this->getIdentifier($handler);

            //Set the configuration
            $identifier->getConfig()->append($config);

            $handler = $identifier;
        }

        $this->_handler = $handler;
        return $this;
    }