|
Re: Persistent session (e.g. with cookies) [message #1858287 is a reply to message #1858280] |
Mon, 27 March 2023 11:41 |
|
Hi Michel,
to make your cookie persistent, you have to set max-age in the cookie-config of your web.xml.
This should recover your http session as long as the houskeeping does not start, which typically is 30s after closing the tab (scout.ui.sessionstore.housekeepingDelay).
You may prevent housekeeping by setting the persistent flag on the UISession. This flag was actually introduced for the standalone mode on iOS, so there is no proper API for it, but you should be able to override the isPersistent method of the UISession (the session is a @Bean).
This will also put the client session id into the local storage, so the next time the browser is opened, the client session incl. state of the desktop will be recovered.
|
|
|
|
Re: Persistent session (e.g. with cookies) [message #1858308 is a reply to message #1858305] |
Tue, 28 March 2023 08:24 |
|
The state of the ClientSession is stored in the ui server and attached to the HttpSession. If the HttpSession times out, your webserver will remove it including all attached objects. So no, you cannot restore the ClientSession after a session timeout.
However, you could make sure the session does not expire that fast. If a user is active (creating requests by using the UI), the webserver will automatically increase the lifetime of the session. If the user is inactive but has the browser open, the background poller of Scout will keep the session alive, but only as long as specified by scout.ui.maxUserIdleTime (docs). So, you could increase that value. If the user closes the browser, the regular session timeout of your webserver (see web.xml) will come into place. You could increase this value as well, but keep in mind that the ClientSession uses quite a bit of memory. So I recommend to keep this value low to make sure the webserver can relase unused memory and won't go out of memory if many users connect.
[Updated on: Wed, 29 March 2023 10:20] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03813 seconds