diff --git a/tes/apiendpoints.py b/tes/apiendpoints.py
index 3e419bf563640281c70eca0a85bfdea077170011..22b35b2969c3d48ce0175fd044896d335388511b 100644
--- a/tes/apiendpoints.py
+++ b/tes/apiendpoints.py
@@ -93,6 +93,7 @@ class SSHAgent(Resource):
             sshsess = SSHSession.get_sshsession()
             sshsess.kill()
             SSHSession.remove_sshsession()
+            session.pop('sshsessid', None)
             return []
         except Exception as e:
             import traceback