def is_authenticated(cookie_string, prefix='', rconn=None):
    """Check for a valid cookie, if exists, return True
       If not, return False."""

    if rconn is None:
        return False

    if (not cookie_string) or (cookie_string == "noaccess"):
        return False

    cookiekey = prefix+cookie_string

    try:
        if rconn.exists(cookiekey):
            # key exists, and update expire after ten minutes
            rconn.expire(cookiekey, 600)
        else:
            return False
    except:
        return False
    return True