<!--
{
  "availability" : [
    "iOS: 18.1.0 -",
    "iPadOS: 18.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SecureElementCredential",
  "identifier" : "/documentation/SecureElementCredential/CredentialSession/invalidate()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SecureElementCredential"
    ],
    "preciseIdentifier" : "s:23SecureElementCredential0C7SessionC10invalidateyyYaKF"
  },
  "title" : "invalidate()"
}
-->

# invalidate()

Inmediately invalidates a session.

```
func invalidate() async throws
```

## Discussion

Call this method when your app no longer needs a credential session. The system automatically invalidates a session when it deallocates, or when it encounters underlying errors.

When a session invalidates, its event stream also invalidates and deallocates.

You can invalidate a session while in any session state.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)