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 = "";  

Similar Messages

  • 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

  • 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.

  • 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

  • How does a workflow get triggered when we create a Shopping cart

    Hi all,
    In SRm how does a workflow gets triggered when we create a Shopping cart...what i mean is that in r/3 we use changedocument object or function modules etc..likewise in srm how the wf gets triggere...can anyone help me.
    Thanks&Regards,
    Hari

    Hi martin,
    yes i accept that in SRM also workflows are all started by event...what i mean is in R/3 we go for Change document object(swec) or some other method for event creation...like that in SRM what is there?Just whenwe create a Shopping cart How the workflow is trigerred...suppose if it is trigerred using fm swe_event_create where they might have called the function module.
    Thanks&Regards,
    Hari

  • 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.)

  • Does the browser need to be closed when installing the new flash player?

    I had uninstalled the previous flash player version. Went to the adobe website to download the latest flash player 10.2.152.26. Followed the instructions including using the Adobe Download manager. It just said to click run and said NOTHING about closing out the browser first before installing.
    Should I have closed out the browser first, BEFORE installing???

    Hi, No, not when Uninstalling or Installing from a direct site. Now if you are using the manual Uninstaller/Installer that you put on your Desktop and run from there, then yes.
    Hope that answers your question.
    Thanks,
    eidnolb

  • How does the browser "show-the-user" when a web page is SECURE?

    Whenever I use Firefox I end up filling out a secure form.
    ...however...
    The browser never SHOWS ME that the page IS SECURE.
    All other browsers I have ever used, IE, Opera, Netscape all show the user when they are viewing a secured web page. I need to see that the connection is secure before sending sensitive info.
    anyone?

    The area to the left of the address (green, blue, or plain) shows the type of security offered by the site. More info:
    [https://support.mozilla.com/en-US/kb/Site%20Identity%20Button Site Identity Button | How to | Firefox Help]
    For example, this site has a blue identity area (SSL encryption but not identity verification).
    There is an add-on you can use if you prefer seeing a lock:
    [https://addons.mozilla.org/en-US/firefox/addon/padlock-icon/ Padlock :: Add-ons for Firefox]
    I haven't tried it myself.

  • Why does the browser window change colour when I bookmark a page or click the Downloads button?

    Using Firefox 20 on MacOS - when I click the Downloads button or Cmd-D to bookmark a page, the browser window changes from looking like this:
    https://dl.dropboxusercontent.com/u/35912963/01-firefox-before.png
    to looking like this:
    https://dl.dropboxusercontent.com/u/35912963/02-firefox-after.png
    Any thoughts would be welcome.
    Dan

    Hi there,
    Wow, that looks odd! I have no idea why that would happen, but I wonder if it's related to one of the add-ons you have installed? I see a red icon in the status bar that I'm not familiar with, which leads me to believe that you may have other add-ons installed. One thing to try is to start Firefox Firefox with add-ons disabled (you can do this from the Help menu). If you don't see this problem in that mode, the issue is caused by one of the add-ons. From the Tools menu, you can access the add-ons and disable them one by one. Remember to restart each time and then test it out.
    If none of that takes care of this, my other suggestion would be Firefox Reset: [[Reset Firefox – easily fix most problems]]
    Hope any of this helps.
    Cheers,
    David

  • Does the Browser cach the jnlp-file?

    I have a problem, I think with the browser's caching. As I modify the *.jnlp-File, the old version is loaded, not the new one!
    Or is the old version cached by the webStart-Caching-Mechanism?
    To update the jnlp-file, sometimes it is helpful to clear the Clients webStart cache.
    Is that correct?
    regards,
    ulli

    The browser does in fact cache the jnlp and it can be a real problem. If there is no expiration on the JNLP then the browser may load it from cache instead of going to your web server on the next access. This means you may have modified your JNLP on the server for a new release, but users can start your application WITHOUT GETTING THE LATEST JNLP!
    You can solve this problem by serving the JNLP file from your own servlet (or other HTTP serving technique) and setting the expire header. Setting it to 0 does the right thing.
    Do NOT however, set "Pragma", "no-cache". no-cache stops the browser from writing the JNLP to the file system...this in turn causes a problem when Web Start tries to find the jnlp file after the browser starts Web Start....the jnlp file is not there.
    Note that the JnlpDowloadServlet provided by Sun in the Web Start developers kit does NOT expire the JNLP file...you must fix this code yourself if you want it to work correcly. Sun was supposed to make this source code available but I can't find it anywhere. We used a de-compiler to de-compile the code, fix it and re-jar it.

  • Why does the Browse to OPC item.vi example not work in Labview 6.0?

    I was trying to update my application from Labview 5.1.1 to Labview 6.0, I could not be able to use the DataSocket Vis. Then I opened the example "Browse to OPC item.vi" in Communication examples in Labview 6.0, the Vi was not able to browse the OPC servers on the network. Does anyboy have experienced this and what could be the problem?
    Thanks.
    Attachments:
    Browse_To_OPC_Item.llb ‏13 KB

    Yurong,
    In the documentation for the Browse To OPC Item.vi, it is stated that it uses DataSsocket VIs shipped with versions of LabVIEW prior to version 6i. These VIs are provided with LabVIEW 6i for compatibility. The DataSocket primitives shipped with LabVIEW 6i are not currently fully compatible with OPC. When using DataSocket to connect to OPC Servers, use the older compatibility DataSocket VIs.
    I was able to run this VI and browse to opc://localhost/National Instruments.OPCDemo/SINE:0.0..8.0:2.0
    and didn't have any errors accessing NI OPC Demo server.
    Zvezdana S.
    National Instruments
    Attachments:
    Doc1.doc ‏30 KB

  • Does the browser back/forward literally not work?

    Does anyone else find the Browser/Media tab so frikkin annoying?
    I'm browsing through folders to find samples to put into my project and everytime i go back, it goes back to the last folder full of samples i was in, rather than literally going 'back.'
    It literally doesnt work!
    I also find that we need favourites like Ableton does.
    And... the right click on the home icon and selecting 'set current folder as home' only works whilst you have that session open. When you close and reopen its forgotten!
    Bah Humbug APPLE!

    Spry or regular hyperlinks in a list or nav configuration. Either is better than Flash buttons.
    Thing is, a search bot will read the HTML in those kinds of links (spry or HTML) and index them. That way if you have an event calendar for upcoming shows, or a discography page, it can find them and will be able to make a reference to them in later search engine databases (usually about 72 hours after the indexing). With the Flash buttons there is no code for the bot to find and your upcoming events, or a downloads page if there is one, will never be seen in a search even if people look directly for "fireonmcginnis: schedule", or "music by fireonmcginnis" because to Google, Yahoo, Lycos and the others the pages simply don't exist.
    Spry is great if you have submenus, and since it can be customized using CSS, you can make it match your site layout. You can also do that with regualr hyperlinks and CSS, but spry has a more appealing look to a lot of web users and the submenus are a little harder with basic HTML.
    For the record the script should read: getURL ("http://www.site.com/page.html" "_self"); for the buttons. There'a s drop down to select _self, _blank, _parent etc. when you add the getURL script to the button.
    But... you need to stay away from Flash buttons for navigation or you're really defeating the purpose of putting a band on a website in the first place. It's about exposure and Flash buttons will severely limit that exposure, even if they work properly.

  • 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

  • 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

Maybe you are looking for