def _path_matching(path, dst_path):
    """
        A request-path path-matches a given cookie-path if at least one of   the following conditions holds:
        o  The cookie-path and the request-path are identical.
        o  The cookie-path is a prefix of the request-path, 
           and the last character of the cookie-path is %x2F ("/").
        o  The cookie-path is a prefix of the request-path, 
           and the first character of the request-path that 
           is not included in the cookie path is a %x2F ("/") character.
    """
    plength = path.__len__()
    if plength > dst_path.__len__():
        cond = False
    elif path == dst_path:
        cond = True
    elif dst_path[0:plength] == path:
        if path[-1] == '/':
            cond = True
        elif dst_path[plength] == '/':
            cond = True
        else:
            cond = False
    else:
        cond = False
    return cond
