Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Close Remote Session
#1
Hi!

Every time an user make loggin in the application, the AppId (sessionId) is save in the database.

With this information, I try to terminate the session from another program and my code fail every time.

How can I end the session?

Delphi Seattle
Intraweb 15.2.10

Code:
procedure TFrmSesionUsuario.CerrarSesion(const AAppId: string);
var
  lApp: TIWApplication;
  lExpired, lLocked: Boolean;
  I: Integer;
  lForm: TIWAppForm;
begin
  lApp := gSessions.LookupAndLock(AAppId, lExpired, lLocked);
  if Assigned(lApp) and not lExpired then
  begin
    try
      for I := lApp.ActiveFormCount -1 downto 0 do
      begin       
          lForm := TIWAppForm(lApp.ActiveForms[I]);
          lForm.Release;
      end;
      lApp.SessionTimeOut := 1;
      lApp.Terminate;
    finally
      lApp.Unlock;
    end;
  end;
end;


The lApp variable is always NIL.

How can I overcome this problem?

TIA!
Reply


Messages In This Thread
Close Remote Session - by Rolphy Reyes - 05-04-2021, 09:41 PM
RE: Close Remote Session - by DanBarclay - 05-05-2021, 03:40 AM
RE: Close Remote Session - by Rolphy Reyes - 05-05-2021, 01:43 PM
RE: Close Remote Session - by Alexandre Machado - 05-05-2021, 11:23 PM
RE: Close Remote Session - by Jose Nilton Pace - 05-06-2021, 11:43 AM
RE: Close Remote Session - by Alexandre Machado - 05-11-2021, 10:45 AM
RE: Close Remote Session - by Alexandre Machado - 05-11-2021, 10:45 AM
RE: Close Remote Session - by Rolphy Reyes - 05-11-2021, 03:06 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)