Multiple Sessions Restarting

I’ve got a Web 1.0 app that is being by used by at least two dozen users a day, usually not all at once, and it is having an issue with multiple, if not all, sessions are being closed or restarted. They get the usual “This application has gone offline” page for a few seconds and then it will refresh and send them all back to the front page of the application. I am not sure what could be causing this or where to even begin troubleshooting it as Session.close is not being called as far as I can tell.

Any help would be appreciated!

It sounds like the app is crashing.

As far as I can tell it isn’t, at least the process isn’t closing. I will start looking in my App code though.

I would start by putting some logging code in the app unhandled event and see what do I get…


No, this can happen also while the app is still running. In fact, there are a lot of situations where this could happen.

We notice this behaviour in several situations:

  1. One task takes longer than a specific amount of time. Then either the webbrowser or the webserver kills the connection.
  • Nginx for example closes unresponsive connections after a minute, but this can be changed though settings.
  • Webbrowsers closing connections also after a minute, when a fetch to the server took to long. This is then usually a design flaw in your application.
  1. If you’re using transactions then make sure that you always commit or rollback them. Open transactions can lead to this behaviour as well. I think it has something to do with the database plugins of Xojo. We are using MySQL and we’ve seen this so often.
  2. Mixed Content (https/https) and false CORS preferences can lead to a situation where the browser blocks external scripts and assets, which your app maybe relies on.
  3. There was this bug when ExecuteJavascript teared all sessions down. This happened when you executed JS without having a SessionContextObject in place.
  4. When you use a webtimer, which is a frontend-control then there are also some situations with a resulting session-breakdown:
  • When the timer fires to fast, faster, than the server can compute the executed code, then the Action-events stacks and the server kills the connection eventually.
  • This also happens when you have a high latency. Then it can happen that the timer Action event is sent multiple times in the same second to the server.
  1. If you’re using external scripts, for example with the WebcontrolWrapper, there are some ways to trigger this problem.
  2. If you’re using the open event of wencontainers instead of the shown event to do some vast UI stuff, then it could result in weird behaviours.

These are just the first few reasons we’ve been through the last couple of years. We were newer able to determine why exactly it happend, we were just able to reproduce it sometimes and to develop workarounds.

But, it still happens occasionally in our application. We just got better to avoid most of the situations. Even extended logging didn’t brought us enlightment.

1 Like

After some refactoring in code at the application level and a few days of running the app it seems that this was the issue. Thanks for all the replies!

1 Like
Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.