Fix bug where session that failed to authenticate ends up in session cache.