Jump to content

How To Kill An Active Legacy Session ?


andyhill

Recommended Posts

I am recording every SessionID, IP and UserName for every user who accesses my website. 

I have noticed that some users (either due to impatience or hapatic feedback insensitivities) are running multiple browser sessions at the same time and I want to limit them to a maximum of one session at a time - the current one - by automatically closing any previous ones.

 After fetching previous SessionID and IP used on last access I attempt to close it (release).

 My code below executes correctly but it appears that the legacy session is not removed after calling ReleaseSession - please advise - thanks in advance.

procedure TUniServerModule.KillActiveSession(SessionID, IP: String);
var
  sid: TUniGUISession;
  ActiveSessions: TUniGUISessions; 
begin
  try
    ActiveSessions:= UniServerModule.SessionManager.Sessions;
    sid:= ActiveSessions.GetSession(SessionID, IP);
    sid.ReleaseSession;
  except
  end;
end;

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...