Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Redirect on session timeout
#3
Hi, see this demo:
https://github.com/Atozed/IntraWeb/blob/...roller.pas
Code:
class function TIWExceptionRendererEx.RenderHTML(AException: Exception;
  ARequest: THttpRequest): string;
var
  Addr: string;
begin
  // the goal here is to respond to a session timeout error with a HTML with your address
  if AException is EInvalidSession then begin
    Addr := #39 + 'https://especificURL.com' + #39; // start address enclosed in single quotes
    Result := '<!DOCTYPE html>' +
              '<html>' +
              '<head>' +
              '<script type="text/javascript">' +
              'setTimeout("window.location=' + Addr + '", 1);' +
              '</script>' +
              '</head>' +
              '<body>' +
              '</body>' +
              '</html>';
  end
  else
    Result := inherited;
end;
Reply


Messages In This Thread
Redirect on session timeout - by PDSBILL - 04-16-2021, 05:59 PM
RE: Redirect on session timeout - by DanBarclay - 04-16-2021, 09:10 PM
RE: Redirect on session timeout - by Jose Nilton Pace - 04-16-2021, 10:36 PM
RE: Redirect on session timeout - by DanBarclay - 04-17-2021, 03:14 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)