Clear session when QueryResult is closed