<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: 10.6.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "OpenDirectory",
  "identifier" : "/documentation/OpenDirectory/ODSessionCreate(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Open Directory"
    ],
    "preciseIdentifier" : "c:@F@ODSessionCreate"
  },
  "title" : "ODSessionCreate(_:_:_:)"
}
-->

# ODSessionCreate(_:_:_:)

Creates a session to be passed to node functions.

```
func ODSessionCreate(_ allocator: CFAllocator!, _ options: CFDictionary!, _ error: UnsafeMutablePointer<Unmanaged<CFError>?>!) -> Unmanaged<ODSessionRef>!
```

## Parameters

`allocator`

The memory allocator to use. If `NULL`, the default allocator is used.

`options`

A dictionary of options to associate with the session.

`error`

An error reference for error details. Can be `NULL`.

## Return Value

The created session.

## See Also

[Session Keys](/documentation/OpenDirectory/session-keys)

Keys used when specifying session information.



---

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)