<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/AuthorizationCallbacks/GetSessionId",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@S@AuthorizationCallbacks@FI@GetSessionId"
  },
  "title" : "GetSessionId"
}
-->

# GetSessionId

Reads the session ID.

```
int (*)(struct __OpaqueAuthorizationEngine *, void **) GetSessionId;
```

## Parameters

`inEngine`

An opaque handle that is passed to your plug-in when the authorization engine calls your [`MechanismCreate`](/documentation/Security/AuthorizationPluginInterface/MechanismCreate) function.

`outSessionId`

On output, points to the session ID.

## Return Value

A result code. Possible results are [`errAuthorizationSuccess`](/documentation/Security/errAuthorizationSuccess) (no error) and [`errAuthorizationInternal`](/documentation/Security/errAuthorizationInternal) (Security Server internal error).

## Discussion

The session ID is a unique value provided by the authorization engine for a given authorization session. Normally, all the mechanisms in your plug-in are called in turn for a given authorization session and there is no need to ask for the session ID. However, if you were to launch an authorization daemon (for example) that caches data from different authorization sessions and then uses that data later, you might need to keep track of which session a given data item came from. The session ID is available for your use if you wish to implement such a system.

The authorization engine sends you the entry point to the [`GetSessionId`](/documentation/Security/AuthorizationCallbacks/GetSessionId) function in an [`AuthorizationCallbacks`](/documentation/Security/AuthorizationCallbacks) structure when you call the [`AuthorizationPluginCreate`](/documentation/Security/AuthorizationPluginCreate) function.

---

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)