Jump to content

timeout warning


Wilton Ergon

Recommended Posts

 


there are dozens of topics on the forum talking about it, but none that I've tried works.
my timeout is working properly, and ends application in 10 minutes of inactivity, I would just like to display a warning to the user when the inactivity timeout occurs.
already tried to approach this link without success.

in the script, I tried to change mainmodulo by frmprincipal (because it is the name of my main form.

when the time limit is reached, when the user clicks on something, he goes back to login, the user thinks that the connection has fallen due to system failure. and I need to warn him that it is due to the time he spent without using the system.

I also tried to use the mainmodule sessiontimeout event, but it is not fired.

procedure TUniMainModule.UniGUIMainModuleSessionTimeout(ASession: TObject;
  var ExtendTimeOut: Integer);
begin
  showmessage('Tempo expirado',nil);
end;

unigui 1.90.0.1526

 

sessiontimeout 600000 in servermodule

hyperserver

[node_recycling]
enabled=1
recycle_after_secs=3600
recycle_after_sessions=0
recycle_after_idle_secs=700
recycle_when_empty=1

Link to comment
Share on other sites

var IDLE_TIMEOUT = 600; // 10 minuts
var _idleSecondsCounter = 0;
document.onclick = function() {
    _idleSecondsCounter = 0;
};
document.onmousemove = function() {
    _idleSecondsCounter = 0;
};
document.onkeypress = function() {
    _idleSecondsCounter = 0;
};
window.setInterval(CheckIdleTime, 1000);

function CheckIdleTime() {
    _idleSecondsCounter++;
    var oPanel = document.getElementById("SecondsUntilExpire");
    if (oPanel)
        oPanel.innerHTML = (IDLE_TIMEOUT - _idleSecondsCounter) + "";
    if (_idleSecondsCounter >= IDLE_TIMEOUT) {
        ajaxRequest(FrmPrincipal.form, '_idle_timeout', []);    ///-> *****
    }
}
 

**** 

I was not referring correctly to the form. putting the correct name, performed correctly.

procedure TFrmPrincipal.UniFormAjaxEvent(Sender: TComponent; EventName: string;
  Params: TUniStrings);
begin
  if EventName = '_idle_timeout' then
  begin
    uniGUIApplication.UniSession.Terminate('Sua conexão foi encerrada por inatividade de mais de 10 minutos');
  end;

end;

 

this event does not fire at the login screen, I put the same code there too, but with just 1 minute (enough time for the user to enter the password),
this prevents the system from being open on the login screen indefinitely

 

  • Like 1
Link to comment
Share on other sites

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...