<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVSystemRouting",
  "identifier" : "/documentation/AVSystemRouting/AVSystemRoute-5s2um/removeSession(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVSystemRouting"
    ],
    "preciseIdentifier" : "s:15AVSystemRouting0A5RouteC13removeSessionyyAA0acE0CF"
  },
  "title" : "removeSession(_:)"
}
-->

# removeSession(_:)

Removes a session from the active route.

```
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.

## 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 ``doc://com.apple.avsystemrouting/documentation/AVSystemRouting/AVSystemRouteSession-gp78`` instance.

---

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)