<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: How to remove a "unknown user"-session</title><link>https://answers.axonivy.com/questions/3748/how-to-remove-a-unknown-user-session</link><description>&lt;p&gt;If I logout a user from it's session (session.logoutSessionUser()), the session is still existing with an "unknown user". &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    ISecurityManager secMgr = SecurityManager.getSecurityManager();
    for (ISession ssn : secMgr.getSessions()) {
        if (ssn.getSessionUserName().equalsIgnoreCase("xyz")) {
            ssn.logoutSessionUser();
        }           
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The session disappears only after a timeout (that might be the timeout defined in the tomcat configuration)&lt;/p&gt;
&lt;p&gt;However: Is there a way to close/kill a session immediately after logging out a user?&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/3748/how-to-remove-a-unknown-user-session" rel="self"></atom:link><language>en</language><lastBuildDate>Wed, 27 Mar 2019 10:30:55 -0400</lastBuildDate><item><title>Answer by Reto Weiss</title><link>https://answers.axonivy.com/questions/3748/how-to-remove-a-unknown-user-session/3749</link><description>&lt;p&gt;Hi Stefan&lt;/p&gt;
&lt;p&gt;Do you want to destroy the ivy session or the http session?
You can destroy the ivy session by using the following API:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ssn.getSecurityContext().destroySession(ssn.getIdentifier());
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The http session will not be destroyed by this call. However, there is an open issue XIVY-1091 in our issues database for this.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Reto Weiss, Axon.ivy Support&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reto Weiss</dc:creator><pubDate>Wed, 27 Mar 2019 10:30:55 -0400</pubDate><guid>https://answers.axonivy.com/questions/3748/how-to-remove-a-unknown-user-session/3749</guid></item></channel></rss>