Destroy the session automatically when the browser is closed by user

Is it possible to automatically destroy a session when the browser is closed by the user with the X?
Basically, what we want to do is to create the same effect when the user is closing the browser (with the X button) as when the ordinary log out button is used. That is to have the session destroyed.
Any ideas?
/Carl-Johan

Hope this helps...
Refer note : 904155
from SAP Note 904155----
Symptom
A BSP application is not terminated correctly when the user closes the browser window or navigates to other URL.
The popup window, which appears on browse closure, contains the
text representing <img> HTML element content in the escaped
form, like that:
<IMG WIDTH=quot; HEIGHT=quot; SRC="...
After the popup disappears, the session remains opened.
Since the session is not removed, that may result in database locks that still remain and can be found in transaction SM12.
Other terms
Business Server Pages, WebAS, sessionexit, session termination, SM12, SM04, SYSTEM, session_single_frame.htm
Reason and Prerequisites
Reason:
The problem is caused by the minor code inconsistency in BSP application SYSTEM -> page SESSIONEXIT.HTM.
Prerequisites:
1. The application is using the SYSTEM application page SESSIONEXIT.HTM for logoff. When it runs, suddenly HTML source code appears on the logoff screen.
2. SAP_BASIS 620 SP57 or SAP_BASIS 640 SP15 or SAP_BASIS 700 SP06 are installed.
Solution
Please install SAP_BASIS 620 SP58 or SAP_BASIS 640 SP16 or SAP_BASIS 700 SP07
or
apply the code correction as described below:
1. Go to BSP Application SYSTEM.
2. Select page SESSIONEXIT.HTM and turn on Change mode.
3. Change the line:
<%=application->session_exit( exit_url = app-exit_url namespace = app-appl_ns name = app-appl_name page = app-page_name )%>
to:
<%raw=application->session_exit( exit_url = app-exit_url namespace = app-appl_ns name = app-appl_name page = app-page_name )%>
Arun
P.S Assigning points is a way of saying thank you on SDN
Message was edited by: Arun Varadarajan

Similar Messages

  • How to invalidate a session explicitly when a browser is closed

    hi,
    i am keeping the information of a logged user when he logs succesfully in a session. the session time is maintained for half an hour.
    i am also storing his information in an application object.
    when a user logs out i am invalidating the session and his information is removed from the application object .
    when a person is logged and another person at other place stries to log in with the same username and password, i am making use of this application object to check whether the anyone is looged in with that user id or not. if the id aleady exists in the application object i will not allow the second person to log in and i will provide with a relavent mesasge " already logged in with this ID".
    But the problem is arising when a person loogs in and closes the browser (wth out looging in).
    in this case the session is not invalidated and his information remains in the session and application object.
    when he tries to loog in immediatly after closing the browser, the same checking is done for the duplicate log in and a message is displayed to him saying that " already logged in with this ID".
    he has to wait till the session expires (i,e till 30 min) and then log in
    As this creates problem, i want to invalidate the session the time when the browser is closed.
    i tried with the onUnLoad() methos in javascript, but that method is not only called when closing the browser but also when a link is clicked ot when refreshed the page.
    i am trying with Cookies but i am not gettin ga good approach as how to go forward with this problem.
    Any body who can solve this please....reply soon or mail me
    Its very Urgent................
    Thanks
    sowjanya

    2.Any business critical web site should not allow
    multiple users to
    work under same account at same time.Not true. My customer's web site is "business critical" and they explicitly wanted to be able to login multiple times with the same ID. At least in this scenario we completely circumvent your problem.
    The Javascript solution will never be 100%. What happens if their internet connection drops and doesn't come back? Suppose their OS crashes? What if their power goes out? What if IE crashes? What if JS is turned off? What if the user just walks away and leaves the browser open forever?
    You may be trying to get too much control, which on the web always leads to failure. Maybe a better alternative would be to warn the user that is logging in the second time that there is an outstanding login and that the previous user will be logged out if he proceeds. Then, keep a record of the event in case someone is messing with other accounts (although, since he obviously knows the username and password it is probably a user concern.)

  • Persisting a session even when the browser is closed

    i want to persist a user session even when the browser is closed. How to do it through cookies. I know i define a cookie, set its max age and then put that in response. But its not working.
    I am using I.E

    i am not sure if i am doing something wrong. the cookies are enabled and i see that for ie 7, if i open a new tab the session is maintained but if i open a new window (of I.E. 7) altogether then the session is not maintained. Interestingly the code is working in firefox. is there some problem with the I.E. only?

  • How to logout an user when the browser is closed?

    Hi,
    does someone knows how to logout an user when the browser is closed?
    Thanks.

    Hi,
    There is an api wwctx_sso.cleanup_sessions which removes old sessions. This takes a parameter "p_hours_old" which indicates the age of the sessions which need to be removed. There is a job which runs which in turn calls this api to clean up sessions which are 7 days old or 168 hours old. You can see this from the dba_jobs table. You can try running this api.
    Thanks,
    Sharmila

  • What happens when the Browser is Closed?

    Hi,
    Does anyone know for sure what happens to your CF template that is running on  the CF server when the browser is closed by the user.  Does the CFML continue to  be processed or is the template aborted?
    Suppose the user hit's submit to  a long running process (relatively) and the user closes the browser.  Does your  code keep running?  Or does CF abort the process?
    This seems to be a  tricky question as I've posed it indirectly for an e-commerce related question  involving CFHTTP (which may be different).
    Thanks,
    hefterr

    The code will keep running, CF has no concept whatsoever of the fact the browser has closed.

  • How do I close a PDF document automatically when the browser is closed?

    I have a web app writen in HTML/ASP. In order to acccess this app, our users have to enter a password and user id. Once on the main page of the app, they can click on a link which opens the reader in another window. Quite often, when finished with the app, they close the browser, but leave the reader window open (with sensitive information). It is becoming to riskly to hope that they remember to close that window also, even with visual reminders. I would like for that window to close automatically when the browser with the app is closed.
    Can this be done?

    Let me elaborate a little more on what I am trying to do.
    (1) A website (#1) is opened after entering a UID and PWD.
    (2) Within website #1, a link is clicked which opens a second web app (#2) in a seperate window using window.open().
    (3) Within website #2, a user can click on a link which opens a PDF as _SELF.
    (4) If the user:
         (a) exits out of website #1 by closing the brower
         (b) we would like to automatically close the PDF from website #2 also, as this contains sensitive information and most of the time the users are forgetting to close it

  • Does the sharedObject get destroyed when the browser is closed?

    hey guys, so i just wanted to make sure that when my internet browser is closed it destroys or clears my sharedObject??
    right now i wasnt sure so im doing somehting like the following
    public var sharedObj:SharedObject;
    if(sharedObj != null){
         sharedObj.clear();
    sharedObj = SharedObject.getLocal(...);
    i just wnated to make sure that this is the most effective way to destory the sharedObject just in case there is one left in the browser...
    is there another way to make sure i clear the sharedObjects??

    hello cyber0897,
    No sharedObjects are stored in a cookielike textfile on the clients harddrive, As far as I know there is not an option like with cookies to be destroyed after the browser closes.
    The reset you wrote should be in another order:
    var mySharedObject:SharedObject = SharedObject.getLocal....
    //the above will never give null, because it is created when it doesnt exist.
    //the if (object != null) is useless because of the above, in your post it will be always null, since it is not instantiated...
    mySharedObject.clear();
    mySharedObject.flush(); //not sure if this is neccesary
    You could reset the sharedObject when initializing your application, but if you just want to store variables and get them wherever you need them in your app you could use the singleton class below
    Usage:
    <s:TextInput id="text1" text="@{PrefObj.instance.myString} />
    <s:TextInput id="text2" text="@{PrefObj.instance.myString} />
    (the @ only works in flex 4)
    PrefObj.as
    package
        import flash.events.EventDispatcher;
        [Bindable]
        public final dynamic class PrefObj extends EventDispatcher {
            private static var _instance:PrefObj = new PrefObj();
            public function PrefObj(){
                if (_instance != null){
                    throw new Error("PreferencesManager can only be accessed through PreferencesManager.instance");
            public static function get instance():PrefObj {
                return _instance;
            //add your variables here:
            public var myString:String = "";  

  • How to force the end of an user session when the browser is closed?

    Hi,
    When the user close the browser, the portal session remains. If the user open a new browser window, we ill be back to the portal without the need of a new Login. Is there any way to force a new login in this situation. A similar problem happens also when there is a reboot in the application server. After the reboot, all users can connect to the App Server without the necessity to login.
    Is ther any way to avoid this kind of behavior?
    Thanks.

    Ok... Its as i thought... unfortunatly...
    Gonna mark your latest post again as possible solution, just in case someone comes with any sort of out of the box thing...
    Thx for your help Kglad

  • How to call a method when the browser is closing

    Hello,
       In my application I need to execute a specific treatment when the WD4A application is closing.  So how can we have a handle method for this specific event.
       I've seen some documentation about the "exit plugs" , and about the doonclose method of the window.. but I don't think it can be useable for me in this case.
    Can you please help me
    Thanks in Advance
    Hamza

    I wrote an insert into the method i set up a break point, the program never call this code and therefore, the new row is never inserted.
    But i think, it's a misunderstand. 
    to summarize :
    I have an application in WD4A
    The application is running, and then I decide to close the browser (in my case internet explorer) and before the browser close I want to execute a piece of code.
    If the method wddoonclose is to be used, is there any default handler or listener to trigger it automatically on the browser closing ?
    If no, how to trigger a method base on this special event .
    Thx
    Hamza

  • Can a thread created in an applet still run after the browser is closed?

    Dear all,
    I was able to make an applet's thread keep running even the web page changed to other page. Is it possible to make a thread spawned by an applet keep running even if the browser is close? I am using signed applet and JRE1.3.1_02. Thank for answer.
    [email protected]
    Arthur Pan

    No. A thread is part of a process and if the browser closes that process will (generally) be destroyed.

  • Must the browser be closed to INSTALL flash player 10.0.32.18?

    I know the browser needs to be closed to UNINSTALL, but nowhere on the download page of adobe fp does it say the browser needs to be closed when installing. I raise this question because when you do a fp download and there is not an issue, you don't seem to have to close out the browser when you are on the adobe download site
    Just want to make sure I did it right ( see my post about installing fp 10.0.32.18 when one gets the "getPlus Error")

    <<<1. It appears that I have been able to install it despite the GetPlus+ Error  operating system error!  16236.203.235, Right?>>
    Correct. Good job.  But that's not any different than installing it from the EXE install in tn_19166 (which I think we advised earleir)
    <<<<_______
    2. Does it make any difference that my browser was open ( to the adobe site FP download page) when I  clicked the link which took me to fpdownload.adobe.com/get/flashplayer/current/install_flash_player_ax.exe and  I clicked run when the pop up box asked to you want to run this file?
    ** my browser was closed when I ran the UNINSTALL Tool, but Open when I downloaded the install of flash Player 10
    ?>>>>>>>
    This doesn't always matter. The browser can be open as long as no SWF content is present on any of the pages that are open.  It's active SWF content that forces the installer to need to be closed.
    <<<<<<<<<<3. Since my Browser was open( and on the adobe download page) during the install of the flash player 10, do I need to uninstall it and then reinstall it with the browser closed? ( the page did not indicate I needed to save the install file and close the browser before install)>>>>>>>>
    No. If it works don't mess with it.
    <<<<<<<<4. Or since it appears I have 10.0.32.18, I should just leave it alone at this time? ( iam able to view video on you tube and of course get the ads that run using flash player on other sites)>>>>>>>
    Correct. You fixed it, now move on.   We are working with several customers to figure out what is causing these DLM errors.

  • Is it normal to get logged out of sync after the browser is closed? In other words I have relog into it everytime I open up Firefox.

    After I have created an account, set everything up, and close the browser, next time I open up firefox, it says set up sync, instead of sync. Then I have to set up sync> I already have and account>I don't have the device with me> etc.
    Windows 7 64 bit.

    Make sure that you aren't clearing your passwords when Firefox closes.
    Options > Privacy -> History <br >
    Is '''clear history when Firefox closes''' check-marked? <br />
    Check the '''''Settings''''' button.

  • "Firefox has stopped working" message everytime the browser is closed

    Everytime I close the browser, I get "Firefox has stopped working" message. I have Firefox 18 on a Windows 7 64-bit machine.
    I also uninstalled and re-installed firefox but the issue still remains

    Certain Firefox problems can be solved by performing a ''Clean reinstall''. This means you remove Firefox and any leftover program files and then reinstall Firefox. Please follow these steps one by one:
    #Download the latest Desktop version of Firefox from http://www.mozilla.org and save the setup file to your computer.
    #After the download finishes, close all Firefox windows (click Exit from the Firefox or File menu) and confirm all upcoming messages.
    #Now, uninstall Firefox by following the steps mentioned in the [[Uninstall Firefox from your computer#w_uninstall-firefox|Uninstall Firefox]] article.
    '''IMPORTANT:''' On Windows, the uninstaller has the option to remove your personal data and settings. Make sure that you do '''not''' check this option; otherwise all of your bookmarks, passwords, extensions, user customizations and other Firefox [[Profiles|user profile data]] will be removed from your computer.
    After uninstalling Firefox on Windows, delete the "Mozilla Firefox" program folder, located by default in one of these locations:
    * '''(On 32-bit Windows)''' ''C:\Program Files\Mozilla Firefox''
    * '''(On 64-bit Windows)''' ''C:\Program Files (x86)\Mozilla Firefox''
    #Go to the Windows Start menu and click on "Computer".
    #In the Explorer window that opens, double click Local Disk (C:) to open the C:\ drive.
    #Find the "Program Files (x86)" folder or "Program Files" folder.
    #* On 32-bit Windows, double-click the '''Program Files''' folder to open it.
    #* On 64-bit Windows, you will see a "Program Files (x86)" folder AND a "Program Files" folder. Open the '''Program Files (x86)''' folder.
    #Look for a '''Mozilla Firefox''' folder. If you find one, right-click it and select ''Delete'' and confirm that you want to move the folder to the Recycle Bin.
    Now, go ahead and reinstall Firefox:
    #Double-click the downloaded installation file and go through the steps of the installation wizard.
    #Once the wizard is finished, choose to directly open Firefox after clicking the Finish button.
    Please report back to see if this helped you!

  • Session doesnt expire even after the browser is closed.

    Hi All,
    I have facing this issue for quite some time now.
    1. I login into my application using Firefox. User now can view below the line pages.
    2. Open another window of firefox.
    3. Close the window open in the first step.
    4. Hit the application URL in the second firefox window and u find the user still logged in and can very well browse through all the below the line pages.
    5. Same thing occurs when we use two tabs of the same browser.
    How can i stop this 4m happening?

    Not by using Reflection (the subject of this forum).

  • Panorama never saves the pages after the browser is closed. Will there be such feature in the future? And another thing, i cant never submit a feedback through the browser, because it tells me im not running the latest beta build when im using 4.12pre.

    Windows 7, Minefield 4.0b12pre (updated 2011-02-09)

    Well, with 4.0 beta there is the option of restoring a previous session on demand (thumbs up for that :P) AND what's even nicer it even saves the state of Panorama.
    Just tried it and if you have tab groups defined in Panorama when you close Firefox, if you choose to restore the session when you restart the next time (either by using the Restore button on Firefox's default homepage or the option in the History menu) Panorama gets restored as well.

Maybe you are looking for

  • Trouble backing up and restoring voice memos

    I tried to save my voice memos from my iphone 5s to my (pc) computer.  I successfully did this one month ago, I created a backup of my iphone and then synced the iphone with the computer.  Now a month later I am trying to do this again with the new v

  • Can't believe the caching bug is STILL there

    Hi, I MUST be missing something. It can't be true that this has not been fixed after so many years. So well, the problem is, every time you load an external asset or file, say for example using a Loader object or a URLLoader object (the same happened

  • Macbook doesn't register TV

    Hi, I am trying to connect my mid-2010 Macbook Pro (running version 10.9.4 of OS X) to a brand new Magnavox TV. I am using an HDMI cord and a mini DisplayPort, both of which have worked in the past. When the TV is off, my computer recognizes the exte

  • Can I print separate layers on the same page?

    I have a 10 page 3.5 x 9 booklet that I need to print. Each page has it's own layer. I need to print out mockups of it and I'd like to be able to fit 3 layers to a page so I don't waste a ton of paper. Is there a way to do this? Thanks!

  • Elapsed Time delay only works once in state machine

    Hello.  I'm having problems using the elapsed time delay to show the seconds remaining on a wait step in a simple state machine.  I would like to have a front panel count down showing the time left for the step.  I thought the elapsed time delay was