The problem it seems that has nothing to do with my timeout logic. The stuck sessions appear even without it with and with keepalive=true on all forms.
When the problem appears (this is only once in a while - about once or twice a day - usually at night at low traffic times), no sessions are terminated anymore. Even if I call Terminate, nothing happens. To test, I added this code to my application:
and no sessions were terminated (about 95% of the active sessions when the problem occurs will have the levelstring='' and activeform=nil). To test some more, I'll put the same code without the "if" and try to terminate all active sessions. I'll report back when I have the results.
When the problem appears (this is only once in a while - about once or twice a day - usually at night at low traffic times), no sessions are terminated anymore. Even if I call Terminate, nothing happens. To test, I added this code to my application:
Code:
xList := GSessions.LockList(False);
try
for i := 0 to xList.Count - 1 do
begin
App := TIWApplication(xList[i]);
if (TIWUserSession(App.Data).LevelString = '') and (App.ActiveForm = nil) then
App.Terminate;
end;
finally
GSessions.UnLockList(xList);
end;and no sessions were terminated (about 95% of the active sessions when the problem occurs will have the levelstring='' and activeform=nil). To test some more, I'll put the same code without the "if" and try to terminate all active sessions. I'll report back when I have the results.

