Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
(Re)start session on QueryStatus from TIWMonitor
#3
Hi Alexandre,

I went ahead yesterday with changes to the current version IW15.3.12
  • In IW15.3.12 I can't make a difference in the function TIWMonitor.jsCallbackName between the situation
    ** No server or network problem and
    ** Server is back but session doesn't exist
I understand the current implementation to not create a session on QueryStatus but by making it possible to detect the second situation I would be able to restart a new session.
Therefor I changed the initial value of the xValue variable to -2 in IWCommon.IW.Session.queryStatus. onError the would call TIWMonitor.jsCallbackName with value == -2 and with -1 when there is no session.

My TIWMonitor.jsCallbackName looks like:

Code:
function monitorCalled(value) {
  if (value === -2) {
    // network error, see updated IWCommon.IW.Session.queryStatus
    $('#no-server').show();
  }
  else if (value === -1) {
    // server back but session gone, should be restarted
    window.location.reload(true);
  }
  else {
    $('#no-server').hide();
  }
}

This didn't work at first. I got a 404 Not found exception. I don't exactly understand why but the solution seems setting TIWSessionController.PostRedirectGet = prgEnabled. It's still not 100% foolproof but it is a good start.
Preferable I would be able to start a new session from monitorCalled() without the need to reload() so it would keep trying when it doesn't work the first time.
Reply


Messages In This Thread
RE: (Re)start session on QueryStatus from TIWMonitor - by jeroen.rottink - 09-05-2023, 01:09 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)