---
title: GetSessionId
framework: security
role: symbol
role_heading: Instance Property
path: security/authorizationcallbacks/getsessionid
---

# GetSessionId

Reads the session ID.

## Declaration

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

## Parameters

- `inEngine`: An opaque handle that is passed to your plug-in when the authorization engine calls your doc://com.apple.security/documentation/Security/AuthorizationPluginInterface/MechanismCreate function.
- `outSessionId`: On output, points to the session ID.

## Return Value

Return Value A result code. Possible results are errAuthorizationSuccess (no error) and errAuthorizationInternal (Security Server internal error).

## Discussion

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 function in an AuthorizationCallbacks structure when you call the AuthorizationPluginCreate function.
