Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

IAM.SESSION.KILL

Last updated
IAM.SESSION.KILL session-id | user
Group
IAM
Complexity
O(N) where N is the number of sessions
Arity
2 (exactly, counting the command name)
Flags
admin
HotKV Cloud
Not available
On-Premise
requires the enterprise-iam license feature

IAM.SESSION.KILL ends a session and closes the connection that has it. With a session ID (from IAM.SESSION.LIST) it ends that one. With anything else it is taken as a login name, alice or ldap:alice, and ends every session of that user on this node.

Sessions belong to the node they are on, so this acts on the node you send it to, and it is not copied to the replicas or the other nodes of a cluster. To log a user out everywhere, run it on every node, or take their roles away with IAM.USER.UNASSIGN, which applies everywhere.

An integer in RESP2 and RESP3: the number of sessions ended (0 if there was none), or the error NOLICENSE enterprise-iam requires a HotKV license. Contact sales@hotkv.com.

127.0.0.1:6379> IAM.SESSION.KILL 2
(integer) 1
127.0.0.1:6379> IAM.SESSION.KILL 2
(integer) 0
127.0.0.1:6379> IAM.SESSION.KILL alice
(integer) 2

HotKV-only command.

IAM.SESSION.LIST, CLIENT KILL