<!--
{
  "availability" : [
    "iOS: 18.1.0 -",
    "iPadOS: 18.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SecureElementCredential",
  "identifier" : "/documentation/SecureElementCredential/CredentialSession/state-swift.property",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "SecureElementCredential"
    ],
    "preciseIdentifier" : "s:23SecureElementCredential0C7SessionC5stateAC5StateOvp"
  },
  "title" : "state"
}
-->

# state

The current state of the session.

```
var state: CredentialSession.State { get async }
```

## Discussion

Sessions start in the [`CredentialSession.State.management`](/documentation/SecureElementCredential/CredentialSession/State-swift.enum/management) state. Calls to the wired or card emulation APIs change the state to [`CredentialSession.State.wired(credential:)`](/documentation/SecureElementCredential/CredentialSession/State-swift.enum/wired(credential:)) or [`CredentialSession.State.cardEmulation(credential:)`](/documentation/SecureElementCredential/CredentialSession/State-swift.enum/cardEmulation(credential:)). Leaving wired or card emulation mode returns the state to [`CredentialSession.State.management`](/documentation/SecureElementCredential/CredentialSession/State-swift.enum/management).

Explicitly invalidating the session, encountering an error, or the app entering the background changes the state to [`CredentialSession.State.invalid`](/documentation/SecureElementCredential/CredentialSession/State-swift.enum/invalid). An invalid session can’t return to one of the other states.

---

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)