Run query_posts if SESSION is empty?

if ( empty($_SESSION['r1']) ) {
    global $query_string;         
    query_posts($query_string . "&cat=-" . $id);
}

This should work, depending on $id is set.