def start_session(self, request, force = False, set_cookie = True):
    """
    Starts a new session for the provided request, by
    default the session is created even if a previous one
    already exists in the request.

    An optional set cookie flag may control if the cookie
    value should be returned to the client side.

    :type request: Request
    :param request: The request to be used.
    :type force: bool
    :param force: If a session must be created even if a previous
    one is already created and set in the request.
    :type set_cookie: bool
    :param set_cookie: If the set cookie header must be set
    in the request indicating the new session to the client.
    :rtype: Session
    :return: The session that has just been created.
    """

    # start a session if none is started and then
    # retrieves it from the request
    request.start_session(force = force)
    request_session = request.get_session()

    # in case the set cookie flag is not set the
    # cookie must be removed from the request
    # session (this way the client is not updated)
    not set_cookie and request_session.set_cookie(None)

    # returns the "just" created request session
    # to the caller method so that it may be used
    return request_session