Jump to content

Recommended Posts

Posted

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;

 

Posted

Instead of killing session,

You can forbid access by displaying a message when the user attempt to login with the same machine ( IP) :

"Oups...you have already an active session..bla...bla...bla..."

:)

Posted

It actually has to do with my Google Maps License.

Google will not accept the same IP, same Device (mobile in my case) concurrently having two sessions using GeoCoder/GetCurrentPosition.

I need to destroy the legacy session. 

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...