def get_session_id(self, request):
    """
    Retrieves the session id for the session that exists
    in the given request.

    :type request: Request
    :param request: The request to be used.
    :rtype: String
    :return: The session id that exists in the given request.
    """

    # tries to retrieve the request session
    request_session = request.get_session()

    # in case the request session
    # is invalid returns an invalid value
    if not request_session: return None

    # retrieves the session id and returns
    # it to the caller method (as defined in spec)
    session_id = request_session.get_session_id()
    return session_id