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.
Comments
#1) in %SYS find the sessions by this Stored Procedure:.png)
#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-3020:47:16 jeff1
zAOMQO8MC8 UnknownUser 0 /ih/csp/documatic/ 2025-04-3020:50:531Add your code snippet and I'm good to nuke some sessions even when the Management Portal is unavailable 😉
FYI the most recent beta VSIXes of Server Manager and the ObjectScript extensions now do their best to end web sessions when they're exiting or restarting.
The relevant versions are v3.10.1-beta.2 and v3.0.2-beta.9 respectively.
A similar change in the Language Server extension is being prepared.