Jump to content

Problem with sessions in hyperserver


aristeo

Recommended Posts

I have a problem with my HyperServer, It's not closing all sessions, when these are finished.

So I'm trying to figure it out differently ...
With a UniThreadTimer in the Servermodule with an interval of 1 minute. I have a code like the following:

procedure TUniServerModule.UniThreadTimer1Timer(Sender: TObject);
var
  i:Integer;
  Sesion:TUniGUISession;
begin
  UniServerModule.SessionManager.Sessions.Lock;
  try
    for i:=UniServerModule.SessionManager.Sessions.SessionList.Count-1 downto 0 do
    begin
      Sesion:=UniServerModule.SessionManager.Sessions.SessionList[i];
      if (MinutesBetween(Now,Sesion.LastTimeStamp)>(SessionTimeout div 1000 div 60)+5) then
      begin
        sesion.ReleaseSession;
        Sesion.Terminate('Ha superado el tiempo de inactividad. Se cerró la sesión');
      end;
    end;
  finally
    UniServerModule.SessionManager.Sessions.UnLock;
  end;
end;

it goes through all the sessions and the one that since its LastTimeStamp has passed (SessionTimeOut div 1000 div 60) +5 (5 tolerance) minutes. I'm trying to log out.
With this solution, there are still open sessions. Could anybody suggest a solution. ?

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...