---
title: "removeSession(_:)"
framework: avsystemrouting
role: symbol
role_heading: Instance Method
path: "avsystemrouting/avsystemroute-5s2um/removesession(_:)"
---

# removeSession(_:)

Removes a session from the active route.

## Declaration

```swift
final func removeSession(_ session: AVSystemRouteSession)
```

## Parameters

- `session`: The session to remove from this route. If the session is not currently associated with this route, this function has no effect.

## Mentioned in

Routing and streaming media to remote devices

## Discussion

Discussion Call this function to unregister a session from the route when playback ends or when you no longer need the session. Removing a session stops any ongoing communication associated with that session and releases system resources. If the session is currently active, this function stops the session before removing it. important: Always remove sessions when they are no longer needed to ensure proper cleanup of system resources and network connections. To start new playback after removing a session, create a new AVSystemRouteSession instance.
