close browser connections

Hello,

I’m looking for a way to close all browser connections for a user.
So if a user clicks on a “Finish” or “Cancel” button on the webapp the browser closes all its sessions and realease its ressources on the server.
(Of course it should not shut down the server or other user sessions)

I’ve tried the following:

'app.AutoQuit = true Session.Quit
This closes the browser’s connection… but I have found that it also influences other browers that are connected to the server (browsers become unresponsive)

Then I’ve tried this:
My app has 4 pages, I’ve found that if I close each page then it works.
But the problem here is that I don’t know how many pages are open before I try to close them:

WebPage1.close WebPage2.Close WebPage3.Close WebPage4.Close

There is a webPage.count property so next I’ve this (which seems to work) :

for i=0 to Session.PageCount -1 Session.PageAtIndex(i).Close next

But is this the correct way to close all browser connections?

Thanks

Calling session.quit should be sufficient .
But where do you have the code you posted ?
That matters

Thanks for you answer.

I have all the code in the dismissed event of a modal dialog (that I use for a "Yes\o"dialog):
Here is what I do:
If user presses the button “cancel” then a dialog is shown “do you want to cancel ? Yes/No”.
If the user selects “yes” then I want to close the browser session (in the dismissed event)

[quote=127383:@Heinz W.]I’m looking for a way to close all browser connections for a user.
[/quote]

Why not simply showurl to a static html page ? All sessions pertaining to the user will die automatically.

If the quit is not in the session itself, you MUST call Session.Quit , otherwise you get the global Quit and the app will quit.

But, if the user has multiple browser windows connected to your app, they all have separate sessions. You’ll need to keep track of that with a cookie.

[quote=127438:@Greg O’Lone]If the quit is not in the session itself, you MUST call Session.Quit , otherwise you get the global Quit and the app will quit.

But, if the user has multiple browser windows connected to your app, they all have separate sessions. You’ll need to keep track of that with a cookie.[/quote]

Greg, sorry to ask, but I need your advice. A while ago, you wrote that it was not recommended to use Session.Quit because of a bug. But this post seems to imply it is OK.

I still have an issue with sessions that won’t quit by themselves, so I think of forcing them to quit after a while with a timer and Session.Quit. Will it work ?

I’d try again when 2014r3 comes out.

OK. Great. Thanks.