protected function setSessionCookie($identifier, $sessionId, $lifetime, $path, $domain, $ssl, $httpOnly = null)
    {
        // calculate concrete expiration date/time
        $expire = time() + $lifetime;

        // check for httpOnly - cause only supported >= 5.2
        if (null !== $httpOnly && $this->getFlagStatus('httpOnly')) {
            session_set_cookie_params($lifetime, $path, $domain, $ssl, $httpOnly);
            $result = setcookie($identifier, $sessionId, $expire, $path, $domain, $ssl, $httpOnly);

        } else {
            session_set_cookie_params($lifetime, $path, $domain, $ssl);
            $result = setcookie($identifier, $sessionId, $expire, $path, $domain, $ssl);

        }

        return $result;
    }