4 Replies Latest reply on Oct 29, 2009 9:04 AM by Mugunda

    Logging Out

      I have a seemingly simple approach to logging a person into my application. I have the main application's visible set to fasle and a login box with it's visible set to true. When the user submits a username and password, I check it against the RemoteObject and if they pass, I set the login box's visible to false and the main application to true. I also set some global variables for the application (username, role, etc).

      My problem is when I have the user log out, I reverse the items above. Set the variables back to nothing and then set the login box back to visible (true) and the main application to false. Looks good, but each section of the application is module and if you were to log back in, they stay in the same state they were when the user left.

      Should I be unloading the modules on logout so they get reloaded when the user logs in? I know that if the user shuts down the browser, all is good, but I have a inactivity manager (a timer that logs them out if there is no mouse movement, mouse click, or keyboard movement).

      How does every else 'log the user out' if you also use modules? Thanks.
        • 1. Re: Logging Out
          Sunil Guttula
          There is no need to unload the modules explicitly. I remove the components created for the application so it goes back to the original login state.
          • 2. Re: Logging Out



              I know this is a old thread, but any one  knows the answer please help me.


            I have a modular application with blazeds.

            Once I have many modules loaded in tab naviagtor. And when the user simple logout.  I just close remove the tab navigator and bring the login box.


            Everything works fine for the first time, when the user logs again without a refresh.  The modules  which was not loaded first time works fine.  But the modules which was loaded first time throws random Type Error etc.



            TypeError: Error #1034: Type Coercion failed: cannot convert flexlib.controls::PromptingTextInput@6152a851 to flexlib.controls.PromptingTextInput.
                at mx.core::UIComponent/createReferenceOnParentDocument()
                at mx.core::Container/createComponentFromDescriptor()
                at mx.core::Container/createComponentsFromDescriptors()
                at mx.core::Container/createChildren()
                at mx.core::UIComponent/initialize()
                at mx.core::Container/initialize()
                at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()
                at mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::childAdded()
                at mx.core::Container/addChildAt()
                at mx.core::Container/addChild()


            All my modules are in Current Domain. and I have a refrence for History mager, popup manager and imported all possible pakages in maim application.



            I tried to  unload modules on logout. but did not make any difference.



            Hope you understand the problem.



            • 3. Re: Logging Out
              vu.tuan.anh Level 1

              Can you try add HistoryManager in your main application's action script:


              private var hist:HistoryManager;


              and add historyManagementEnabled="false" in your <Application > tab?


              Last time i encountered similar problem as you and solved by this approach.



              Tuan Anh

              • 4. Re: Logging Out
                Mugunda Level 1



                I added a refrence for PromptingTextInput in my main application, then i did not get this error, seems some code sharing problem between modules and current domain etc.


                Thanks for your reply.