Fix session validation introduced in ae509d2a0e

The introduction of session validation was preventing login