Ending a session on browser close only (firefox)

I'm trying to end a user's session when they close the browser, because they never logout properly.
I need to change a value in the db after they close the browser only.
<script type ="text/javascript" >
var clicked = false;
var xmlHttp
var browser = navigator.appName;
function CheckBrowser() {
if (clicked == false) {
xmlHttp = GetXmlHttpObject();
xmlHttp.open("GET", "../LogOut.aspx", true);
xmlHttp.onreadystatechange = function () {
if (xmlHttp.readyState == 4) {
//alert(xmlhttp.responseText)
xmlHttp.send(null)
if (browser == "Netscape")
alert("Nog een fijne dag.");
else {
//alert("Redirected");
clicked = false;
function GetXmlHttpObject() {
var xmlHttp = null;
try {
// Firefox, Opera 8.0+, Safari
xmlHttp = new XMLHttpRequest();
catch (e) {
//Internet Explorer
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
catch (e) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
return xmlHttp;
</script>
That works for every browser except firefox.
Please help me with this.
Grant

Hi MrFunktastic,
This is not the right forum for your question, the
javascript section of ASP.NET forums may provide you more help.
Thank you!
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • How to kill session on browser close

    Can anyone tell me, how to invalidate the session on browser closes. I am using Internet Explorer as
    browser.

    Hi anmol10
    if evnafets is to be believed, there is no 100% surefire way to do this. This is doing my head in a bit - I refuse to believe that there isn't some way around this.
    I've been trying all kinds of things, kicking off threads that keep track of the sessions etc, but to no avail.
    Let us know if you think of anything!

  • IPlanet Messaging Server -- kill session at browser close

    iPlanet Messaging Server 5.2 HotFix 2.09
    We found a potential security risk.
    When a person loads Messenger Express through the web and closes their browser, another person can come in behind them and resume the previous persons session. This is accomplished by going through the browser history and accessing any of the links that point inside the mail client.
    When the browser closes, the session isnt killed. Its only killed/inaccessible if the user times out or clicks log-out. We've tested this on just about any browser we can get our hands on.
    Is there a fix/patch/workaround for this? I've combed the documentation and the site and can find nothing.
    We are using the product in an University environment and this can be particularly nasty in the labs.
    Thanks!

    iPlanet Messaging Server 5.2 HotFix 2.09
    We found a potential security risk.
    When a person loads Messenger Express through the web
    and closes their browser, another person can come in
    behind them and resume the previous persons session.
    This is accomplished by going through the browser
    history and accessing any of the links that point
    inside the mail client.Yep. that's true. And, it 's not possible to "fix" that. The reason it cannot be fixed, is that http is stateless. The server can't know when you simply close a browser, instead of you still being there.
    There is an idletimeout that defaults to 10 minutes.
    >
    When the browser closes, the session isnt killed. Its
    only killed/inaccessible if the user times out or
    clicks log-out. We've tested this on just about any
    browser we can get our hands on.Right. This is a basic limitation of the http protocol. It's not something we CAN fix.
    >
    Is there a fix/patch/workaround for this? I've combed
    the documentation and the site and can find nothing.
    We are using the product in an University environment
    and this can be particularly nasty in the labs.You will have to educate your users to log out. That's all I can suggest.
    >
    Thanks!
    ashley

  • Force end of session when user closes window without logging out

    I want to protect sensitive employee data. Does anyone know how to force a user's portal session to be terminated after a user closes a window with the "X" instead of logging out?

    Web application is connectionless. So there is no way to tell if a user has disconnected. If the user diligently logout, then invalidating a session is no problem. However, if you wish to invalidate the user upon closing of window, I suggest you drop that idea and change to different approach.
    1. If you are trying to impose single logon policy, you may consider invalidate an existing session if the same user login again.
    2. If you really need to invalidate a user session as soon as he is inactive (or closes window). I suggest you set a very small timeout interval (maybe 3 minutes). Then for all the pages, implement a simple invisible IFRAME that will keep refreshing itself (say every 2 minutes) on a dummy JSP/servlet URL. The fact that this IFRAME always hit the URL at 2 mins interval will keep the user session valid. Once the browser window is closed, the session will be invalidated in max 3 mins time.
    The final suggestion is to drop that idea altogether, the point is ... implement such feature is like twisting web application to do something that it is not design to do naturally.

  • At times I will close my firefox browser When I go back to open my browser I get a message stating that firefox is running The only way I can get my browser open is to restart my computer Why

    At times I will close my firefox browser When I go back to open my browser I get a message stating that firefox is running The only way I can get my browser open is to restart my computer Why

    Sounds like Firefox is "hanging at exit". That problem is frequently caused by an Extension or a Plugin. Read all of the following articles.<br /><br />
    NOTE: Establish a habit of exiting/closing Firefox with Firefox button > Exit or File > Exit to allow an orderly shutdown of Firefox and closing of all of the files that Firefox has open.
    #Stop the Firefox process:
    #*[http://kb.mozillazine.org/Kill_application Mozillazine - Kill application]
    #*Windows 7 users click [http://www.techrepublic.com/blog/window-on-windows/reap-the-benefits-of-windows-7s-task-manager/2576 here]
    #*Mac users: http://techheavy.com/2011/02/the-mac-task-manager/
    #Why Firefox may hang:
    #*[http://support.mozilla.org/en-US/kb/Firefox+hangs Firefox hangs] (see Hang at exit)
    #*[http://kb.mozillazine.org/Firefox_hangs Firefox hangs (Mozillazine)] (see Hang at exit and Closing Firefox properly)
    #*[https://support.mozilla.org/en-US/kb/Firefox+is+already+running+but+is+not+responding Firefox is already running but is not responding]
    #Use Firefox Safe Mode to find a problem with an Extension or Plugin:
    #*Don't check anything when entering Safe Mode, just continue
    #*If the problem does not occur in Safe Mode it is probably an Extension or Plugin causing the problem
    #*See:
    #**[[Safe Mode]] and [http://kb.mozillazine.org/Safe_Mode Safe Mode (Mozillazine)]
    #**[http://support.mozilla.org/en-US/kb/Troubleshooting+extensions+and+themes Troubleshooting extensions and themes]
    #**[http://support.mozilla.org/en-US/kb/Troubleshooting+plugins Troubleshooting plugins]
    #**[http://support.mozilla.org/en-US/kb/Basic+Troubleshooting Basic Troubleshooting]
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You may need to update some plug-ins. Check your plug-ins and update as necessary:
    *Plug-in check --> http://www.mozilla.org/en-US/plugincheck/
    *'''''Adobe Shockwave for Director Netscape plug-in''''': [https://support.mozilla.org/en-US/kb/Using%20the%20Shockwave%20plugin%20with%20Firefox#w_installing-shockwave Installing ('''''or Updating''''') the Shockwave plugin with Firefox]
    *Adobe PDF Plug-In For Firefox and Netscape: [https://support.mozilla.org/en-US/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox#w_installing-and-updating-adobe-reader Installing/Updating Adobe Reader in Firefox]
    *Shockwave Flash (Adobe Flash or Flash): [https://support.mozilla.org/en-US/kb/Managing%20the%20Flash%20plugin#w_updating-flash Updating Flash in Firefox]
    *'''''Next Generation Java Plug-in for Mozilla browsers''''': [https://support.mozilla.org/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]

  • Applications closes browser when using firefox.

    I've installed firefox and I'm trying to access applications, but when the initial menu is displayed the browser closes.
    I also tried using the following url :
    http://<hostname:port>/dev60cgi/f60cgi
    and the same thing is happening.
    Has anyone seen this before or have any suggestions?

    Is the problem occurring on the Forms front end, or web? Is JInitiator installed on your client?
    If Firefox is crashing on you when you try to open Forms, then try installing JInitiator via Internet Explorer first. I found that Firefox is a bit picky when installing plugins... I could not get mine to download Jinitiator as it did not like the fact thet it was "Unsigned".
    Once I installed Jinitator though, I managed to open up Forms from inside Firefox.
    Hope that helps
    B.

  • Session termination when close the browser

    Hello
    Is there any way I can close all sessions when user closes the browser by clicking the X button on the top right hand corner of the browser instead of logging out.
    Please help as this is a serious security concern I am facing with my application.
    Thanx..
    Deepak

    deepak_bran wrote:
    Hello
    Is there any way I can close all sessions when user closes the browser by clicking the X button on the top right hand corner of the browser instead of logging out.
    You have to write code that captures the window closing event and send a request (ajax will do) to the server to fire off the session invalidation.
    Google for "handle window closing in browsers". AFAIK, there is no standard event that works on FF, IE and Safari - so if cross browser compatibility is a requirement, you have problems. There are workarounds that googling will lead you to.
    Another option - If possible use per browser cookies for your session - the session finishes when the browser is closed. Mind you, the session would still be alive on the server side and would get recycled only when the session inactive interval is exceeded.
    cheers,
    ram.

  • I am getting an alert in my Antivirus for Buffer Overflow whenever I launch or close my Firefox Browser. This has been happening I upgraded to the latest FF

    I am getting an alert in my Antivirus for Buffer Overflow whenever I launch or close my Firefox Browser. This has been happening since I upgraded to the Firefox 15. I didn't have this problem before. I having been using Firefox since many years & never faced such an issue. But this new issue has saddened me. Also whenever I close my Firefox browser the process is not getting ended in the Task Manager. When I try to launch again its throwing an alert saying that "the firefox is not responding. You must close the existing firefox process or else restart your system". Please debug this as I have been fellow open-source lover & would be happy if you guys release a fixed update & if no one else should starts facing this issue ever again. Thanks in Advance guys!!!

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do not click the Reset button on the Safe mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    *https://support.mozilla.org/kb/Troubleshooting+plugins

  • I am trying to download the new version of Firefox but when I try its says to close all firefox connections but I don't have any open. The only open window is the one to start the download only

    I am trying to download new version of Firefox. After I try to run the program it states to close all Firefox versions but there is no Firefox open except for the download. What else can I do

    Do you have the "Green Arrow" icon on one of your toolbars? That usually will list your most recent downloads with a button to open the folder where they are saved.
    If you don't have that, you can open the full download list using either:
    * Ctrl+j
    * Tools > Downloads
    * History > Show All History, then click Downloads in the left column
    Can you find the download listed there and click the "Open Containing Folder" button?
    Are you downloading Flash or Acrobat/Reader?
    For Flash try: http://get.adobe.com/flashplayer/
    For Acrobat/Reader, you may not need an update.
    Firefox's plugin check site only recognizes the Adobe XI (11) series as current, but if you have checked for updates in your Adobe Reader X or Adobe Acrobat X product (Help > Check for Updates) then you do not need to update the plugin. For this older Reader/Acrobat version, please rely on Adobe for information on available updates and not the plugin check site.

  • When I start Firefox, I only get the background of my browser in the Firefox window. I already reinstalled it, but that doesn't fix the problem.

    When I start Firefox, I only get the background of my browser in the Firefox window. I the normal window for 1 second, but then it changes in only the background window. So without toolbar, or navigation. I already reinstalled it, but that doesn't fix the problem.

    Try to disable hardware acceleration in Firefox.
    Tools > Options > Advanced > General > Browsing: "Use hardware acceleration when available"
    https://hacks.mozilla.org/2010/09/hardware-acceleration/
    https://support.mozilla.org/kb/how-do-i-upgrade-my-graphics-drivers

  • Every time I reboot, Safari has reverted to my default browser, despite setting Firefox as default (both with Firefox and Safari) in my previous session. What else can I try?

    Following the instructions here only work temporarily:
    How to make Firefox the default browser
    ... If you have more than one web browser, Windows ... article will show you how to make Firefox your default browser.
    Setting Firefox as the default browser does not work
    ... browser is described in the How to make Firefox the default browser article. Most external programs ... , click Set this program as default . Internet tab under Web Browser , choose Firefox in the drop-down.
    OCCASIONALLY I can hear my laptop fan whirring excessively when using the web. If it happened too much, I've quit the browser and the laptop soon cools off. This started when using Safari, and was why I thought I'd try Firefox for a while. Apart from the default browser issue, I've found Firefox easier to use and more reliable. I can't say for sure that this 'overheat' issue has never happened with Firefox since I installed it.

    This is caused by a problem with the file that stores customizations. For details of how to fix it see https://support.mozilla.com/kb/Toolbar+keeps+resetting

  • My firefox browser is only opening the page to about 10cm deep although it's full screem width. It started doing this about a week ago. I've uninstalled and reinstalled it but it's still too short and I can't drag it to full size, it just pings back. Plea

    My firefox browser is only opening the page to about 10cm deep although it's full screem width. It started doing this about a week ago. I've uninstalled and reinstalled it but it's still too short and I can't drag it to full size, it just pings back. Please help?
    == This happened ==
    Every time Firefox opened
    == 12/07/2010

    Hello Susan.
    It's possible that you are having a problem with some Firefox add-on that is hindering your Firefox's normal behavior. Have you tried disabling all add-ons (just to check), to see if Firefox goes back to normal?
    Whenever you have a problem with Firefox, whatever it is, you should make sure it's not caused by one (or more than one) of your installed add-ons, be it an extension, a theme or a plugin. To do that easily and cleanly, run Firefox in [http://support.mozilla.com/en-US/kb/Safe+Mode safe mode] (don't forget to select ''Disable all add-ons'' when you start safe mode). If the problem disappears, you know it's from an add-on. Disable them all in normal mode, and enable them one at a time until you find the source of the problem. See [http://support.mozilla.com/en-US/kb/Troubleshooting+extensions+and+themes this article] for information about troubleshooting extensions and themes and [https://support.mozilla.com/en-US/kb/Troubleshooting+plugins this one] for plugins.
    If you need support for one of your add-ons, you'll have to contact its author.
    If the problem is not disappears when all add-ons are disabled, please tell me, so we can work from there.

  • Trouble detecting browser close in Internet Explorer

    Please help!
    I'm trying to detect when the browser closes (or tab closes, or page reloads, etc.) so that I can save user information. I've followed the advice of others on the web, and have it working with Firefox, but not IE. The code in my wrapper is below, which attempts to get access to the embedded swf object a variety of ways to presumably handle multiple browsers. PLEASE HELP!
    //  Function to get a reference to the embedded swf file
                        function getFlashMovieObject(movieName)
                          if (window.document[movieName])
                              return window.document[movieName];
                          if (navigator.appName.indexOf("Microsoft Internet") == -1)
                            if (document.embeds && document.embeds[movieName])
                              return document.embeds[movieName];
                          else // if (navigator.appName.indexOf("Microsoft Internet") != -1)
                            return document.getElementById(movieName);
    Here's the code that calls this function:
                        window.onbeforeunload = function() 
                            var myApp = getFlashMovieObject("MySwf");
                            return myApp.onCloseApplication();
    Here's the code that embeds the swf:
                      var flashVars = {};
                      var strHref = window.location.href;
                      if ( strHref.indexOf("?") > -1 )
                            var strQueryString = strHref.substr(strHref.indexOf("?")+1);
                            var aQueryString = strQueryString.split("&");
                            for ( var iParam = 0; iParam < aQueryString.length; iParam++ )
                                var aParam = aQueryString[iParam].split("=");
                                flashVars[aParam[0]] = aParam[1];
                    var params = {};
                    params.quality = "high";
                    params.bgcolor = "#ffffff";
                    params.allowscriptaccess = "sameDomain";
                    var attributes = {};
                    attributes.id = "MySwf";
                    attributes.name = "MySwf";
                    attributes.align = "middle";
                      //create your instance of your SWF
                      swfobject.embedSWF("MySwf.swf", "flashContent", "100%", "100%", "10.0.0", "expressInstall.swf",
                        flashVars, params,attributes);

    To make the hyperlinks in PDF file work, do the following:
    Open your Adobe Reader
    Then select Edit à Preferences… from the Action Bar.
    To make the links active, select Documents (under Categories).  On the right side, now under PDF/A View Mode, using the drop-down change  “Only for PDF/A documents”  to  “Never”.   Now click the OK button.

  • Capturing browser close event

    Hello everyone,
    Even though this question has been answered before, I find that none of the answers seem to work for me.
    My problem is the following: Locks are placed on records and tables at certain points in my application. But if the user simply closes the browser without closing the application properly, all the locks are still in place. So I need to catch an event that allows me to ABAP my way out of this.
    I have the following BSP page which loads my application:
    function startBSPApplication()
    function endBSPApplication()
      <frameset id="<%=guid %>_FRAMESET" rows="*,0" onload="startBSPApplication('<%=guid %>_A');" onunload="exitBSPApplication();" noresize framespacing="0" frameborder="0" border="0">
        <frame name="<%=guid %>_A" src="session_default_frame.htm">
        <noframes>This browser does not support frames.</noframes>
      </frameset>
    The start and end functions simply start and end a session, and I find myself unable to actually call an ABAP function in there. All ABAP code placed inside the javascript functions is called everytime the page is loaded, not everytime the function is called and that's not what I want.
    I also already tried the <bsp:htmlbEvent> tag, but I couldn't get that to work either. I tried it like this:
    Notice however that I wrote this on top of the frameset. Does this mean that the onunload event will be called twice and does this cause a problem?
    I tried to call the onDestroy event from within my endBSP function, but nothing happened either.
    <htmlb:content design="design2003" >
      <htmlb:page title="Capture browser close " >
        <htmlb:form>
          <bsp:htmlbEvent id      = "myid"
                          onClick = "onDestroy"
                          name    = "onDestroy"/>
          <script for="window" event="onunload"  type="text/javascript">
               alert('Starting the Server Event');
               onDestroy();
           </script>
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    Does anybody have another suggestion, or notice me overlooking something?
    Thank you in advance,
    Niels.

    Hi Eddy,
    I can't find anything really helpful in that blog. Except maybe adding the onbeforeunload attribute to my frameset and calling a JS function to back it up.
    The problem still persists that any ABAP you put in a JS function is executed regardless of wether or not the function is actually called.
    I need to get to my DO_HANDLE_EVENT somehow when the user closes the window.

  • Trying to install flashplayer 10 it says I need to close mozilla firefox how do I do that?

    I am trying to install flash player # 10 and get a warning that I need to close mozilla firefox can you tell me how to do that?

    File > Exit or Firefox Button > Exit
    Then verify that Firefox is completely down, give it 30 seconds before checking then
    use Ctrl+Shift+Ext switch to the "Processes" tab ( win7 only shortcut) then
    if firefox.exe is running end the process
    if plugin-container.exe is running end the process

Maybe you are looking for

  • Clear Drag and Drop On Enter

    Does anyone know if there is a way to reset a drag and drop interaction through an On Enter action? Here's the need: The learner does the drag and drop interaction. They continue through the rest of the module. They choose to restart the module with

  • New OTN Web Services Center

    Check out the new OTN Web Services Center at: http://otn.oracle.com/tech/webservices/ The new center includes: * Hosted live Web services like SMS messaging, OTN news feeds and even the scott/tiger database schema all available as Web services * Tuto

  • ORA-20100: ORA-01116: error in opening database file

    Hi - I'm hitting this error for the first time. Anyone encountered this before? Any suggestions will be very appreciated. Thanks! 141 EXCEPTION 142 143 when others then 144 raise_application_error('-20100',SQLERRM); 145 End; 146 / 20080207 20080312 D

  • Meaning of tag column in lookup code

    Hi, I would like to disable some values in lookup code, but some values have value in tag column (Y). So it is impossible to disable them. The lookup code I would like to update is CONTACT_TITLE (in receivables lookups). How can I disable these tagge

  • Java io error when attempting to load PLSQL content

    Anyone have an issue loading PLSQL content (package, procedure, function)? I can connect to a database and do DML, DDL, browsing. However, when I attempt to open or create PLSQL content, I get the java.io error (see below). I have 1.5 JRE installed.