<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 4.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CryptoTokenKit",
  "identifier" : "/documentation/CryptoTokenKit/TKTokenSession",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "CryptoTokenKit"
    ],
    "preciseIdentifier" : "c:objc(cs)TKTokenSession"
  },
  "title" : "TKTokenSession"
}
-->

# TKTokenSession

A token session that manages the authentication state of a token.

```
class TKTokenSession
```

## Overview

A token session communicates with its delegate to perform operations with its token that are bound to the authentication state.

A session is always instantiated by a [`TKToken`](/documentation/CryptoTokenKit/TKToken) instance through the token’s delegate when the framework detects access to the token from a new authentication session.

> Important:
> Never share the authentication status of a token, such as the PIN entered to unlock a smart card, with other token sessions.

## Topics

### Creating Token Sessions

[`-  initWithToken:`](/documentation/CryptoTokenKit/TKTokenSession/init(token:))

Initializes a token session with the specified token.

### Responding to Authentication Events

[`delegate`](/documentation/CryptoTokenKit/TKTokenSession/delegate)

The token session delegate.

[`TKTokenSessionDelegate`](/documentation/CryptoTokenKit/TKTokenSessionDelegate)

The interface that a session instance delegate implements to respond to token session authentication events.

### Accessing the Token

[`token`](/documentation/CryptoTokenKit/TKTokenSession/token)

The token to which the session is bound.

## Relationships

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Hashable`](/documentation/Swift/Hashable)

### Inherited By

[`TKSmartCardTokenSession`](/documentation/CryptoTokenKit/TKSmartCardTokenSession)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)