Question
· Apr 30

Clearing Web Sessions from Terminal

I ran into a situation where VS Code consumed all available web sessions and was unable to get to the Management Console to clear them. I was able to establish a terminal session, though.

Is there a method or routine available through the IRIS terminal that allows one to clear web sessions? I've searched the administration and class documentation and haven't found a solution.

Product version: IRIS 2023.1
Discussion (3)3
Log in or sign up to continue

#1) in %SYS find the sessions by this Stored Procedure:

#2 Next based on the SessionId I can open the Object
 

%SYS>set sess=##class(%CSP.Session).%OpenId("kTkyVXwgxw")
%SYS>set pid=sess.ProcessId
%SYS>if $l(pid) set tSC=$$DeleteSession^%SYS.cspServer(pid)

The last row was found in  
Class %CSP.UI.Portal.CSPSessions
ClassMethod EndSession

Attention. Not every CSP Session has also a pid ! 

Thanks for this! Although ... the answer shows the query running in the Management Portal, which wasn't available to me when I ran into the issue 😁

But this works:

[SQL]%SYS>>call %CSP.Session_SessionInfo()
10.     call %CSP.Session_SessionInfo()

Dumping result #1
ID      Username        Preserve        Application     Timeout LicenseId       SesProcessIdAllowEndSession
P0AtBxzbL9      jeff    0       /ih/csp/healthshare/hicg/       2025-04-30 20:47:16     jeff1
zAOMQO8MC8      UnknownUser     0       /ih/csp/documatic/      2025-04-30 20:50:53         1

Add your code snippet and I'm good to nuke some sessions even when the Management Portal is unavailable 😉