I try to investigate around the Intraweb for Delphi 2010. I have a web page inside a CRM application, and every time the user flips customer, the web page is refreshed. However the sessions of "old" pages remain active, and I get a "the edition is limited to 5 active sessions". How do I remove the old sessions, when a new session is created, it must of cause be the same application id, and only for the current user.
Asked
Active
Viewed 1,341 times
0
-
Maybe this holds the answer. I have build a solution from it, but I can't post an answer before 8 hours. Anyway need to test it with multiply users, but it should work. https://forums.embarcadero.com/thread.jspa?messageID=525644 – user1611655 Oct 07 '13 at 16:42
1 Answers
1
I ended up with this. https://forums.embarcadero.com/thread.jspa?messageID=525644
procedure TIWServerController.IWServerControllerBaseNewSession
(ASession: TIWApplication; var VMainForm: TIWBaseForm);
var
i: integer;
List: TList;
App: TIWApplication;
begin
List:=GSessions.LockList;
try
for i:=0 to List.Count - 1 do begin
App:=TIWApplication(List[i]);
if App <> ASession then begin
GSessions.Remove(App);
App.Free;
end;
end;
finally
GSessions.UnLockList;
end;
ASession.Data:=TIWUserSession.Create(nil);
end;

user1611655
- 41
- 3