---
title: "sessionInvalidated(error:)"
framework: Accessory Transport Extension
role: symbol
role_heading: Instance Method
platforms: [iOS 27.3+]
path: "accessorytransportextension/accessoryfeaturesessionhandler/sessioninvalidated(error:)"
---

# sessionInvalidated(error:)

Notifies the handler when its feature session ends.

## Declaration

```swift
func sessionInvalidated(error: (any Error)?)
```

## Parameters

- `error`: An optional error that indicates why the session ends. A nil value indicates ordinary completion.

## Discussion

Discussion Release your reference to the session when the system calls this method.

## See Also

### Handling the session life cycle

- [sessionStarted(_:)](accessorytransportextension/accessoryfeaturesessionhandler/sessionstarted(_:).md)
