Added `Session.is_valid` method.