I'm using the system securityManager to authenticate my users and discovered that when you close the browser, the users' session remains active. If they re-open the browser, they do not need to log in again unless they specifically logged off before closing the browser.
Is there a way to end their session when they close the browser so that they have to log in again when they re-open the browser ?
force log off when browser closes
Moderators: Jon, Steve, Ian, Dave
-
- Moderator
- Posts: 421
- Joined: Fri Sep 07, 2007 3:44 pm
- Location: Sandy, UK
- Contact:
Hi Segi,
This is quite a tricky thing you want to do. I do not think that you can detect the browser closing (you might want to search the internet more to confirm this). You can only detect whether some one leaves the page.
To do this, you can use JQuery unload call to invoke a client callable function from the browser:
The Client callable script on the server will look like this:
I am not 100% sure whether this will work and I have not tested this. Also this probably will not work if you are using callform.
Steve
This is quite a tricky thing you want to do. I do not think that you can detect the browser closing (you might want to search the internet more to confirm this). You can only detect whether some one leaves the page.
To do this, you can use JQuery unload call to invoke a client callable function from the browser:
Code: Select all
$(window).on('unload', function(){
$eb.executeFunction("endUserSession");
});
Code: Select all
function endUserSession()
{
client.getHttpSession().invalidate()
}
Steve
0 x
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
When a user signs on, the signon details are maintained at session level. When they connect with a new session, they must re-authenticate. In general, if you shut down the browser and restart, a new session is created. Most browsers behave like this. Which browser are you using, and which version?
0 x
-
- Ebase User
- Posts: 649
- Joined: Mon Dec 09, 2013 6:37 pm
I am using Firefox for development and testing. Most of my users are using Google Chrome though and Chrome seems to correctly sign you out when you close the browser but Firefox does not.
Just some additional info. I use the standard Firefox and Firefox developer preview and this happens in both Firefox variants.
Just some additional info. I use the standard Firefox and Firefox developer preview and this happens in both Firefox variants.
0 x
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
My Firefox creates a new session when I shut it down and then restart. You may have Firefox option Open new windows in a new tab instead unchecked on your system (which is not the default). If you do this, each new tab is opened in a separate window, but then shutting down that specific window doesn't end the session because other windows still exist.
For info, no browsers do anything special when they close i.e. they don't notify the server, so the session on the server is still maintained - until it times out. It's the subsequent restart of the browser that is the important part - the browser should then request a new session.
For info, no browsers do anything special when they close i.e. they don't notify the server, so the session on the server is still maintained - until it times out. It's the subsequent restart of the browser that is the important part - the browser should then request a new session.
0 x
-
- Ebase User
- Posts: 649
- Joined: Mon Dec 09, 2013 6:37 pm
Who is online
Users browsing this forum: No registered users and 27 guests