<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "OpenDirectory",
  "identifier" : "/documentation/OpenDirectory/ODSession",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Open Directory"
    ],
    "preciseIdentifier" : "c:objc(cs)ODSession"
  },
  "title" : "ODSession"
}
-->

# ODSession

An `ODSession` object serves as a Cocoa wrapper for an Open Directory session.

```
class ODSession
```

## Topics

### Creating and Accessing Sessions

[`+  defaultSession`](/documentation/OpenDirectory/ODSession/default())

Returns a shared instance of the local session.

[`-  initWithOptions:error:`](/documentation/OpenDirectory/ODSession/init(options:))

Creates a session object directed over proxy to another host.

[`+  sessionWithOptions:error:`](/documentation/OpenDirectory/ODSession/sessionWithOptions:error:)

Returns an autoreleased session object directed over proxy to another host.

### Accessing Node Information

[`-  nodeNamesAndReturnError:`](/documentation/OpenDirectory/ODSession/nodeNames())

Returns the node names that are registered with this session.

### Constants

[ODSession Option Keys](/documentation/OpenDirectory/odsession-option-keys)

Option keys used when creating a session directed over a proxy.

## Relationships

### Conforms To

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

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

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

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

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

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

### 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)