---
title: "ODSessionCreate(_:_:_:)"
framework: opendirectory
role: symbol
role_heading: Function
path: "opendirectory/odsessioncreate(_:_:_:)"
---

# ODSessionCreate(_:_:_:)

Creates a session to be passed to node functions.

## Declaration

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

Return Value The created session.

## See Also

### Related Documentation

- [Session Keys](opendirectory/session-keys.md)

### Working with Sessions

- [ODSessionCopyNodeNames(_:_:_:)](opendirectory/odsessioncopynodenames(_:_:_:).md)
- [ODSessionGetTypeID()](opendirectory/odsessiongettypeid().md)
