# How do I kill a client session?

**URL:** <https://forum.inductiveautomation.com/t/how-do-i-kill-a-client-session/2064>\
**Category:** Ignition\
**Created:** [July 22, 2010, 8:18pm UTC](https://forum.inductiveautomation.com/t/how-do-i-kill-a-client-session/2064 "2010-07-22T20:18:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@Robert](https://forum.inductiveautomation.com/u/Robert)\
**Post date:** [July 22, 2010, 8:18pm UTC](https://forum.inductiveautomation.com/t/how-do-i-kill-a-client-session/2064/1 "2010-07-22T20:18:09Z")

</div>

On our single user demo system, I have an orphaned client that refused to go away.

Our demo system lives in a DMZ so we can access it from the outside world. I was preparing for a demo when I entered an incorrect password. (I had been logging in and out with no problem until then) I got the incorrect user/password notice. I entered the correct password. I was told that a client was already running and was blocked from running the application.

Now I can’t get rid of the “running” client. Because I am connected through a firewall the gateway shows the client connected from the firewalls IP.

I have tried restarting the gateway to no avail.

---

<div class="post-metadata">

**Author:** ![david\_mccutchen](https://avatars.discourse-cdn.com/v4/letter/d/919ad9/32.png) [@david\_mccutchen](https://forum.inductiveautomation.com/u/david_mccutchen)\
**Post date:** [July 23, 2010, 12:50pm UTC](https://forum.inductiveautomation.com/t/how-do-i-kill-a-client-session/2064/2 "2010-07-23T12:50:56Z")

</div>

We do something like this for our admin account in case we forget to logout.

`if "Administrator" in system.security.getRoles() and system.util.getInactivitySeconds() > 900 and not system.security.isScreenLocked():
    system.security.lockScreen()
elif "Administrator" in system.security.getRoles() and system.util.getInactivitySeconds() > 3600:
	system.security.logout()
`

You could link this to a button action and substitute for hostnames,ip’s, or clientid’s, and customize to your needs.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [August 5, 2010, 5:37pm UTC](https://forum.inductiveautomation.com/t/how-do-i-kill-a-client-session/2064/3 "2010-08-05T17:37:37Z")

</div>

The sessions are “remembered” across restarts of the Gateway b/c they are serialized in a file called “.sessions”. You could remove that file when the gateway is shut down and then start it back up.

We had a function for a while where if you were authenticated in the gateway web interface there was a “kill session” link next to each session in the Status section. I removed it b/c I thought it was silly b/c the active clients simply re-established their sessions transparently. I’ll add it back in b/c it would be useful to remove orphaned sessions.
