<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iOSAppExtension: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NowPlaying",
  "identifier" : "/documentation/NowPlaying/RemoteMediaSessionExtension/session(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Now Playing"
    ],
    "preciseIdentifier" : "s:10NowPlaying27RemoteMediaSessionExtensionP7sessiony0E0Qz10AttributesQzYaKF"
  },
  "title" : "session(_:)"
}
-->

# session(_:)

Creates a session configured with the specified attributes.

```
@MainActor func session(_ attributes: Self.Attributes) async throws -> Self.Session
```

## Parameters

`attributes`

The attributes that configure the session.

## Return Value

A configured remote session.

## Discussion> Throws: An error if a session can’t be created.

---

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)