# IAM.SESSION.LIST

> List the logins that are open on this node.

URL: https://docs.hotkv.com/commands/iam-session-list/

```
IAM.SESSION.LIST
```

- Group: IAM
- Complexity: O(N) where N is the number of sessions
- HotKV Cloud: not available
- On-Premise: requires the enterprise-iam license feature

`IAM.SESSION.LIST` returns the sessions open on the node you ask: one for each
connection that logged in with [IAM.AUTH](https://docs.hotkv.com/commands/iam-auth/index.md), or with `AUTH`
as an LDAP user. Sessions belong to their node; a cluster does not copy them.
A connection that logged in with plain `AUTH` as an ACL user, or never logged in,
has no session.

## Return value

An array in RESP2 and RESP3, sorted by session ID, with one flat array of 18
elements (nine names and values) for each session. An empty array if there is
none.

| Name | Value |
| --- | --- |
| `id` | The session ID, as an integer. Use it with [IAM.SESSION.KILL](https://docs.hotkv.com/commands/iam-session-kill/index.md) |
| `username` | The name the login was made with |
| `source` | `local`, `ldap` or `oidc` |
| `identity` | The user the connection runs as, such as `ldap:alice#7`. This is what `ACL WHOAMI`, `CLIENT LIST` and the audit log show. For `local` it is the ACL user |
| `client` | The connection's client ID, as an integer |
| `address` | The address the connection came from |
| `created` | When the session began, as a Unix time in seconds |
| `expires` | When it ends by itself (an OIDC token's `exp`) as a Unix time, `0` if it does not |
| `roles` | The roles it has now, separated by commas; empty for `local` |

Without a license that includes `enterprise-iam` the reply is the error
`NOLICENSE enterprise-iam requires a HotKV license. Contact sales@hotkv.com`.

## Examples

```
127.0.0.1:6379> IAM.SESSION.LIST
1)  1) "id"
    2) (integer) 2
    3) "username"
    4) "erin"
    5) "source"
    6) "oidc"
    7) "identity"
    8) "oidc:erin#2"
    9) "client"
   10) (integer) 44
   11) "address"
   12) "127.0.0.1"
   13) "created"
   14) (integer) 1791751673
   15) "expires"
   16) (integer) 1791755273
   17) "roles"
   18) "app"
```

## Compatibility

HotKV-only command.

## See also

[IAM.SESSION.KILL](https://docs.hotkv.com/commands/iam-session-kill/index.md), [IAM.AUTH](https://docs.hotkv.com/commands/iam-auth/index.md),
[Roles and single sign-on](https://docs.hotkv.com/operate/iam/index.md)