Cleanup in session handling