You are viewing limited content. For full access, please sign in.

Discussion

Discussion

Disconnect User Sessions Using Script

posted on November 9, 2021

User is reaching four sessions connected at a time.  The idle timeout is set and they are able to disconnect sessions in the LF Admin Console.  They are looking for any other options to disconnect sessions.  Does anyone know of other methods for disconnecting user sessions?

 

Is there a way to disconnect user sessions using a script?  How about in SQL?  Where are current sessions located in SQL?

0 0
replied on November 9, 2021 Show version history

You can terminate sessions through the SDK's Laserfiche.RepositoryAccess.Admin ServerManagement class' TerminateSession(int sessionId) method. Though I don't have a ready-to-go script on hand that uses it, that's the function you'll want to call.

To the best of my knowledge, Laserfiche Server sessions are held in memory and are not written to the database.

0 0
replied on November 9, 2021

Thanks Samuel, I've been experimenting with just that method after seeing your script on this answer (ListRepositorySessions).

 

Ultimately this is to address WebLink users who close the browser leaving the session open and then hitting the max limit. It would be more user friendly if instead of just an inactivity timeout that LF would disconnect the oldest session. 

 

SQL does appear to store the session information although that is less useful now since finding your ListRepositorySessions script. The following returns the connected sessions in SQL. 

select count(lfss.sid) as CountSID, lfac.account_name, lfss.sid
from [LFDATABASE].[dbo].[sess_sid] lfss
inner join [LFDATABASE].[dbo].[account_cache] lfac
on lfss.sid = lfac.account_sid
where lfss.isuser = 1
group by lfss.sid, lfac.account_name
order by count(lfss.sid) desc

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.