05-04-2021, 09:41 PM
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
The lApp variable is always NIL.
How can I overcome this problem?
TIA!
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!