It might be most clear to actually extract a function that returns true or false for whether the session has expired