Using timeout webclient

Hi,

You can set a timeout value for webclients in the configuration file web.xml
I’ve set this value to 20 minutes.

What I see happen is that users start webclient and then close the browser or surf to another site.

It looks like that this setting will only work in case the user is doing some action in the webclient within Servoy and if the timeout value has exceeded, that the user gets session expired message.
But in the mean time this user keeps a license in use.

I would like to see that the Servoy Application Server would automatically closes this client when the timeout value has exceeded, so that the license becomes free (only webclient, not smartclient)

Should it work like this?
And can it work like this? Maybe by settting some configuration variable?

Martin

The app. server should close the web-clients/release used licenses when the client is no longer interacting with server (with a timeout of course). Doesn’t this happen already?
Otherwise server would probably fill-up all licenses in no-time.

Or do you mean that this only happens if the client does not close the browser and doesn’t browse to other page? The license should be released after a timeout in this case as well.
So if the client becomes idle for more then timeout it should get disconnected from the server.

You might notice that the client doesn’t disconnect exactly when you are using AJAX and the user does not close the page/browse away from the page. (cause in this case AJAX requests do happen every 5 (configurable) sec - so the client is not considered “idle”)
Wanted to clarify this as my previous post implied that the client would disconnect in this case as well.

Andrei Costescu:
Otherwise server would probably fill-up all licenses in no-time.

This is exactly what was happening. My customer did a mailing. All the receipients had a look at the web application.
Just a short look and then they went back to work again.
I had about 30 webclients idle for more than 30 minutes, keeping all a licensie.

See the situation below.

The web.xml contains the following:

    <session-config>
        <session-timeout>20</session-timeout>
    </session-config>

The server time is:

Server Information
Servoy version 4.1.5 -build 687
Repository version 35 (895d61ef-3255-446e-966d-f89399321361)
Current time: Thu Mar 18 09:39:42 CET 2010
Uptime: 9 days 17 hours 9 minutes 55 seconds

And the one of the connected clients is:

Solution: havelaar_webshop Total number of clients for this solution: 1
Client: 81.82.196.25[81.82.196.25] (Servoy Web Client)
	
Client logged in:	Thu Mar 18 09:01:12 CET 2010
Client idle since:	Thu Mar 18 09:02:10 CET 2010

So this client should have been disconnected by the application server (37 minutes are past)
The client has still the application in the webbrowser, but went away for drinking a coffee for 45 minutes (in this case it’s me :lol: )

So I guess this client should have been disconnected.

Now at 9:44 I even closed the webbrowser tabpanel where the solution was running. So there is really no connection anymore.
Now I’ll wait another 20 minutes to see if that changes anything.

Martin

The “Client idle since” is not the same as browser session idle. It takes into account client operations such as login, queries, locks, transactions, …
The session will not be marked as idle if you keep the browser open because of the AJAX requests that keep happening (as I mentioned in previous post).

So, in your case, client will be disconnected in 20 min after you closed the browser tab.

Thanks Andrei,

I’ll check if the disconnect works when closing the browser tab.

But I also would like to see that I can disconnect a client after a certain idle time (the idle time that is shown on the Clients page)

Is that technically possible?
In that case I’ll make a feature request.

Martin

It is technically possible, although in my opinion it’s not such a good idea. You might have ppl. editing a text area or some field for 20 minutes and then they end up disconnected (maybe other situations as well that do not influence the idle time-stamp from admin page). I think it’s better to teach users to close the apps./windows that they do not use ;). Web-client does take into account the fact that some users might have already closed the browser window when computing license usage.

I would like to see that the Servoy Application Server would automatically closes this client when the timeout value has exceeded, so that the license becomes free (only webclient, not smartclient)

You could have a look at our UserManager plugin. That allows you exactly that. It has a maxWebClientIdleTime that you can set (a different setting is available for smart clients). You could even set a client specific idle time.

Andrei Costescu:
It is technically possible, although in my opinion it’s not such a good idea. You might have ppl. editing a text area or some field for 20 minutes and then they end up disconnected (maybe other situations as well that do not influence the idle time-stamp from admin page). I think it’s better to teach users to close the apps./windows that they do not use ;). Web-client does take into account the fact that some users might have already closed the browser window when computing license usage.

Then this idle timeout should depend on the solution. In case I have an application data-entry, then I agree that it is not a good idea. Here I know who are the users
But I have also solutions which are webshops. In that case it should be disconnect. In this case I don’t know the users, so I can’t teach them. It can be anybody. That is the problem with the license-model of Servoy. With webshops you don’t know how many people will connect. Normally it is very limited, but after a mailing I see a huge number of people trying to connect.

I’ll make request to disconnect webclients after a certain idle time

patrick:

I would like to see that the Servoy Application Server would automatically closes this client when the timeout value has exceeded, so that the license becomes free (only webclient, not smartclient)

You could have a look at our UserManager plugin. That allows you exactly that. It has a maxWebClientIdleTime that you can set (a different setting is available for smart clients). You could even set a client specific idle time.

Thanks I’ll have a look at it

Andrei Costescu:
So, in your case, client will be disconnected in 20 min after you closed the browser tab.

Indeed that is working

How can I read in my solution the “Client idle since” time for each client?

you can’t.

you need the usermanager plugin for that!
viewtopic.php?f=34&t=13858#p72577

Why don’t you just set a logout() method in onHide of the main solution form?
So whenever users navigate away from solution they’re simply logged out and the license is released.

Cheers,
Maria

I hope I can read the idle time, as the server also knows it. I can read the start time of each client from the server database, but this is not enough. The idle time would be useful to shutdown idle clients.

So, if anyone knows how to get it, even a simple workaround, I’m all ears :) Actually, a workaround would be to track all user actions directly in the application and to store the time of the last action. But this complicates the application, and I wouldn’t do it. I’m looking for a simple solution.

Greetings,
Bogdan.

Go for the Usermanager plugin, you will be able to read idle time and do much more. One thing that comes to my mind and it’s very helpful is to be able to see which client is locking a record and notify the user, something that Servoy should do out of the box. You will be able to do everything you do in the admin pages programmatically.

And then there is the totally hack way. Still works:

http://www.servoymagazine.com/home/2007 … ting-.html

Nice article, indeed. :D I didn’t thought about this. David, you are a genius.

Maybe Servoy should think to provide also the idle time. Or maybe even better to add a property to the server: “Shut down idle clients after X minutes”. It would be very helpful.

Another question, when I shut down a web client, even from the server admin page, nothing happen on the client side. The page remain the same. Actually, only is user press a button or something that request data from the server, then the solution is redirected to the error page, and after the user selects again the solution, he is redirected to the expire page, and finally, after the choose again the solution he will have it.
Normally will be that when a web client is shut down, to be redirected to the session expire page.

And even in the Smart Client, it’s not user friendly to just close the application. You can send a message, but that message will disappear with the application when it’s shut down. Normally would be to keep the application open with a message “Session expire” or “Application timeout”, something like this. Because when the user is back on the computer, he must see what happens, not just to find that the application was closed for some reasons he’s not aware of.

Thanks.