Note the ways of deleting sessions are different in manual session management and automatic one. Call
CKSession#clearflags for deleting sessions. A session data is deleted if you call the method, however the session is not deleted. The session is deleted completely when saving sessions by automatic session management.