Fixed a bug causing invalid sessions to appear as valid