How to close a Web Client so it does not consume a license

Hi all,

What is the proper way to close a Web Client so it does not consume a Servoy license?

We are using Servoy 5.2.4 with Enhanced Security enabled and the web client setting “servoy.webclient.useAjax” is set to true.

In the web.xml file on the server, the “” is set to 5 minutes.

If a solution is loaded in the Web Client and the following code is executed when the user clicks a “Log Off” button:

function logOff()
{
security.logout();
application.closeSolution();
}

the default Servoy “Select Solution” page is displayed, however looking at the clients page in the Servoy Admin, the web client is still listed and consumes a license even though the loaded solution shows up as “”. This web client session (and the Servoy license used by it) is released only after the session-timeout period in the web.xml has elapsed.

I can understand that behvior if the user simply closes the browser or navigates to a different site without explicitly logging off, however there should be an option to release immediately the web client session and the used Servoy license. How can we “close” the web client session and release the used license immediately without having to wait for the Tomcat session timeout to expire (which is by default 30 minutes)?

Thanks in advance for your help!

One more detail - we are seeing the same results when using

application.exit();

instead of

application.closeSolution();

the web client session lingers on and consumes a license until the web.xml session-timeout period expires

We use this:

function logout()
{
	var serverUrl = '/servoy-webclient/templates/default/expired.html'
	application.showURL(serverUrl,'_self')
	application.exit()
}

which works perfectly!
(we are also using enhanced security, and we forward to our own expired.html…)
did you test this in a real client/server environment?

Harjo,

Thanks for the suggestion - will give it a try. And yes, the behavior which we are seeing is happening on a real Servoy Application Server and not in the Servoy Developer.

I see that you logout first, I think the application.exit() will never be fired than.
and logout will indeed leave a client open…

try only application.exit()

Harjo,

Yes, having only the

application.exit();

does what we need.
Thanks for your help!

Harjo:
We use this:

function logout()

{
var serverUrl = ‘/servoy-webclient/templates/default/expired.html’
application.showURL(serverUrl,‘_self’)
application.exit()
}




which works perfectly!
(we are also using enhanced security, and we forward to our own expired.html....)
did you test this in a real client/server environment?

Harjo, you are a genius!
I was looking for EXACTLY this (although I am going to use a different URL…)

Thanks!

Rafi