Bug #14483
closedreload-is-new-session is ignored
0%
Description
Affected: WT 4.13.0 (worked in 4.12.6 and before)
Every reload of the page in the browser creates a new WApplication instance.
STR:
- configure
<reload-is-new-session>false</reload-is-new-session> - run attached
main.cpp - reload page in browser --> instance number in the tab title increments
Files
Updated by Michael Seibt 2 days ago
correction: works only with 4.12.0 and before, broken since 4.12.1
complete STR:
- configure
<reload-is-new-session>false</reload-is-new-session>and<tracking>URL</tracking> - run attached
main.cpp - open page in browser without session id
- reloadpage in browser --> instance number is not increment as expected
- open page in browser without session id --> instance number is incremented as expected
- simulate an outdated session id by changing the last char in the address bar
- load this URL --> instance number is incremented as expected but no new session id is created
- reload page --> instance number is incremented again and application state is lost
Updated by Romain Mardulyn 2 days ago
- Status changed from New to InProgress
- Assignee set to Romain Mardulyn
Updated by Romain Mardulyn 2 days ago
- Status changed from InProgress to New
- Assignee deleted (
Romain Mardulyn)
Hi Michael,
This is the expected behavior since 4.12.1.
What happens is that with an incorrect wtd in the request, the server treats the user as a bot until it interacts with the page and sends back request to wt. Since bot sessions are deleted just after being served, they will not have any session id added and will be HTML only.
This was done to fight off bots, constantly reloading some page for no good reason, while still being able to serve them something.
If you do not care about bots and just want the page to reload when that happens, you just have to add the following at the start of your application.
if (rcEnv.isLikelyBotGetRequest() && !rcEnv.agentIsSpiderBot()) {
redirect("");
return;
}
Updated by Michael Seibt 1 day ago
Hi Romain,
thank you for the quick clarification!
The fallback to HTML also explains why the application loaded incompletely on automatic reconnect after server restart due to recompile.
Indeed, we do not need to care about bots.
With redirect("/?_=" + rcEnv.internalPath());, it works well for us.