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

Forum to discuss the Web client version of Servoy.

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

Postby rossent » Mon Jan 03, 2011 1:52 pm

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 "<session-timeout>" 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 "<none>". 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!
Rossen Totev
Argos Software
rossent
 
Posts: 288
Joined: Wed Dec 31, 2008 2:03 pm

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

Postby rossent » Mon Jan 03, 2011 3:06 pm

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
Rossen Totev
Argos Software
rossent
 
Posts: 288
Joined: Wed Dec 31, 2008 2:03 pm

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

Postby Harjo » Mon Jan 03, 2011 3:58 pm

We use this:

Code: Select all
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 Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

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

Postby rossent » Mon Jan 03, 2011 4:04 pm

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.
Rossen Totev
Argos Software
rossent
 
Posts: 288
Joined: Wed Dec 31, 2008 2:03 pm

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

Postby Harjo » Mon Jan 03, 2011 4:30 pm

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 Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

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

Postby rossent » Tue Jan 04, 2011 11:05 am

Harjo,

Yes, having only the

application.exit();

does what we need.
Thanks for your help!
Rossen Totev
Argos Software
rossent
 
Posts: 288
Joined: Wed Dec 31, 2008 2:03 pm

Re: How to close a Web Client so it does not consume a licen

Postby rafig » Fri Jul 01, 2011 7:01 pm

Harjo wrote:We use this:

Code: Select all
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
Servoy Certified Developer
Image
rafig
 
Posts: 706
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK


Return to Servoy Web Client

Who is online

Users browsing this forum: No registered users and 2 guests

cron