Jump to content

TUniGUISession.Terminate(); problem


Freeman35

Recommended Posts

Hello,

I attached demo app. It's from unigui's demos. "Session List"

I added two buttons. Start project, then open more then one tab. (2-3...tabs) 

Click to "Get Sessions" button, and see opened session list. Maroon colored line is tab's session mean. select to other, then click to "Alert to  Session" and look at to that tab. You will not see alert. Id select maroon colored session and click to Alert to  Session, you will see Alert.

And "Terminate  Session" button. just terminate self, I mean, if maroon color line on grid. If select another session then click to Terminate  Session button, nothing...

Terminate self session, then click to "Restart application" link and click to "Get session" terminated session(s) geting in new list too?

What is wrong???? Is this a bug ???

I tested in build 1484.

Session List.7z

Link to comment
Share on other sites

  • Administrators

GetSessions method is not meant to be used by developers, but if you want to use it here is the correct way:

U:= UniServerModule.SessionManager.Sessions.GetSession(ClientDataSet1.FieldByName('sessionid').AsString, ClientDataSet1.FieldByName('ip').AsString);
if Assigned(U) then
  try
    U.TerminateAfterSecs(3);
  finally
    UniServerModule.ClearSessionBusy(U);
  end;

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...