Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Session Unload Error Page(Error when logged in after session expiration)
Session Unload Error Page [message #1840645] Wed, 21 April 2021 09:56 Go to next message
Seydou Zakou is currently offline Seydou ZakouFriend
Messages: 44
Registered: May 2020
Member
Hi All,
We have a scout application in production. When a user left his browser window after a certain amount of time without disconnecting, his session expires. After logged in again, instead of redirecting the user to the last outline and page or the default outline, he is redirected to an error page at the URL:
 http://x.x.x.x:8080/unload/1:xxxxxx... 
Note that the redirected URL point to the /ROOT context whereas the application is deployed to http://x.x.x.x:8080/scout-app ! .If he go back to application by typing the url in the browser Address Bar, the application default page appear with his session logged in.
Attached a screen shot of the error the error screen.
Does anyone has encountered a similar error? what can cause this error?

Scout version: 10.0.28
Conatiner: Tomcat 9
JVM: adopt-openjdk-11

[Updated on: Thu, 22 April 2021 09:46]

Report message to a moderator

Re: Session Unload Error Page [message #1840685 is a reply to message #1840645] Thu, 22 April 2021 06:14 Go to previous messageGo to next message
Luka Cavic is currently offline Luka CavicFriend
Messages: 47
Registered: August 2014
Member
I have same problem..
Re: Session Unload Error Page [message #1840706 is a reply to message #1840645] Thu, 22 April 2021 09:36 Go to previous messageGo to next message
Seydou Zakou is currently offline Seydou ZakouFriend
Messages: 44
Registered: May 2020
Member
Hello,

Note that this error doesn't occur in version 10.0.8 but in version 10.0.28 of scout.
Re: Session Unload Error Page [message #1840781 is a reply to message #1840706] Fri, 23 April 2021 14:46 Go to previous messageGo to next message
Claudio Guglielmo is currently offline Claudio GuglielmoFriend
Messages: 256
Registered: March 2010
Senior Member
Hi,

can you please update to the latest version (10.0.45) or downgrade to the previous one (10.0.27)? Does it work with these builds? It looks to me that 10.0.28 is corrupt and should not be used.
Do you use Tomcat based authentication or the Scout Login form?
Re: Session Unload Error Page [message #1840804 is a reply to message #1840781] Sun, 25 April 2021 08:21 Go to previous messageGo to next message
Faruk Caglar is currently offline Faruk CaglarFriend
Messages: 33
Registered: August 2019
Member
Hi,

I have the same problem with version 11.0.12
Re: Session Unload Error Page [message #1840821 is a reply to message #1840804] Mon, 26 April 2021 07:37 Go to previous messageGo to next message
Claudio Guglielmo is currently offline Claudio GuglielmoFriend
Messages: 256
Registered: March 2010
Senior Member
Hi,

could you provide some more details? What browser are you using? After what time does it happen? What do you exactly mean by leaving the window? Do you open another application so that the browser is in the background or do you minimize the browser or maybe just open another tab? What is your configured session timeout in web.xml?

When the session timeout expires a message box should appear so the user can reload the page. Does this message box ever appear? Do you use Tomcat based authentication or the Scout Login form? Have you set any session related properties in the config.properties (e.g. scout.ui.maxUserIdleTime?).

Can you reproduce the error with a newly created Scout project?
Re: Session Unload Error Page [message #1840831 is a reply to message #1840821] Mon, 26 April 2021 09:44 Go to previous messageGo to next message
Nils Israel is currently offline Nils IsraelFriend
Messages: 72
Registered: May 2010
Member
Hi,
we also had the problem with version 11.0.12.

As a workaround we replaced the

_sendRequest method in our custom Session and removed the call to navigator.sendBeacon so it falls back to "legacy synchronous AJAX call".

Here is the fragment, we removed in our implementation:

    if (request.unload && navigator.sendBeacon) {
      // The unload request must _not_ be sent asynchronously, because the browser would cancel
      // it when the page unload is completed. Because the support for synchronous AJAX request
      // will apparently be dropped eventually, we use the "sendBeacon" method to send the unload
      // request to the server (we don't expect an answer). Not all browsers support this method,
      // therefore we check for its existence and fall back to (legacy) synchronous AJAX call
      // when it is missing. More information:
      // - http://stackoverflow.com/questions/15479103/can-beforeunload-unload-be-used-to-send-xmlhttprequests-reliably
      // - https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/7nKMdg_ALcc
      // - https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon
      navigator.sendBeacon(this.unloadUrl + '/' + this.uiSessionId, '');
      return;
    }
Re: Session Unload Error Page [message #1840839 is a reply to message #1840831] Mon, 26 April 2021 13:14 Go to previous messageGo to next message
Faruk Caglar is currently offline Faruk CaglarFriend
Messages: 33
Registered: August 2019
Member
Hi Claudio,

it happens after the session timeout. The message box appears. After reloading the page the login page appears (Scout login). After entering the (correct) login-credentials the HTTP 404 (Not found) message appears (see Seydou' screenshot). As Seydou described
http://x.x.x.x:8080/unload/1:xxxxxx...
appears in the address line of the browser (I am using Chrome). Deleting the part of the address starting with "unload..." the application and the last outline appears. We have to set any session-related properties.
Re: Session Unload Error Page [message #1840848 is a reply to message #1840839] Mon, 26 April 2021 15:39 Go to previous messageGo to next message
Claudio Guglielmo is currently offline Claudio GuglielmoFriend
Messages: 256
Registered: March 2010
Senior Member
Hi all,

thank you for the responses. We were able to reproduce and fix it: https://git.eclipse.org/r/c/scout/org.eclipse.scout.rt/+/179828
I don't know yet when the next builds are planned, but in the meantime, you can easily workaround it by making sure, that requests to /unload/ won't be forwarded to the login page.

Just adjust your code in your UiServletFilter in the following way:

if (req.getPathInfo().startsWith("/unload/")) {
  resp.sendError(HttpServletResponse.SC_FORBIDDEN);
  return;
}
BEANS.get(ServletFilterHelper.class).forwardToLoginForm(req, resp);


@Nils: I suggest you replace your workaround with the above one, because I think the legacy fallback won't work for modern browsers, so your app probably doesn't do a proper unload anymore.
Re: Session Unload Error Page [message #1840869 is a reply to message #1840848] Tue, 27 April 2021 11:33 Go to previous messageGo to next message
Faruk Caglar is currently offline Faruk CaglarFriend
Messages: 33
Registered: August 2019
Member
Thanks Claudio!!!
Re: Session Unload Error Page [message #1841053 is a reply to message #1840848] Sun, 02 May 2021 09:51 Go to previous messageGo to next message
Seydou Zakou is currently offline Seydou ZakouFriend
Messages: 44
Registered: May 2020
Member
Hi all,

Thank you for your fruitful conversation which I was unable to participate. We will implement your suggestions @Claudio. Thank you.
Re: Session Unload Error Page [message #1841074 is a reply to message #1840645] Mon, 03 May 2021 06:52 Go to previous messageGo to next message
Mark Ashworth is currently offline Mark AshworthFriend
Messages: 40
Registered: January 2012
Member
Good morning,

I was wondering if the following commit would also fix the issue that sometimes happens when developing and that I have noticed on Azure.

If the server is rebooted while the user is logged in the system (or has the login page open), when the system is online again the user logs in but instead of going to the designated outline, the server shows the unload path.

https://github.com/eclipse/scout.rt/commit/a8d426a13482a0d48e2623cc060e9910f95f7a90


Kind regards,
Mark Ashworth
Re: Session Unload Error Page [message #1841083 is a reply to message #1841074] Mon, 03 May 2021 12:16 Go to previous messageGo to next message
Beat Schwarzentrub is currently offline Beat SchwarzentrubFriend
Messages: 207
Registered: November 2010
Senior Member
Hi Mark

Yes, that is very likely the same problem. When the server is restarted, all sessions are lost. For a specific user this behaves the same as if the session had been terminated by the app server due to a timeout.

Regards,
Beat
Re: Session Unload Error Page [message #1841107 is a reply to message #1841083] Tue, 04 May 2021 05:57 Go to previous message
Mark Ashworth is currently offline Mark AshworthFriend
Messages: 40
Registered: January 2012
Member
Hi Beat,

Awesome, this is great news. :-)

I though I needed to write a request handler, implementing the doGet, to overcome this issue.


Kind regards,
Mark Ashworth
Previous Topic:Custom Field with additional state
Next Topic:Is it posssible to set the outline to top
Goto Forum:
  


Current Time: Wed May 08 20:53:43 GMT 2024

Powered by FUDForum. Page generated in 0.07107 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top