Avatar

Level 3

Hello,

I've made some progress on the separation, but I'm running into some new issues.

If I load the Manage Templates app in a clean browser window (all cookies, active logins etc cleared), the app loads and starts without a problem, and the flex config loads successfully.  After entering my login details in my own custom login view, these get sent to the server, authenticated, and I get a UserEvent.AUTHENTICATION_SUCCESS event.  On capturing this event, I call userManager.loadUser().  From there I get the following fault event:

[FaultEvent fault=[RPC Fault faultString="There was an unhandled failure on the server. The FlexSession is invalid." faultCode="Server.Processing" faultDetail="null"] messageId="8C8F187B-1C0E-5D5C-3E28-94EAB5FE5605" type="userLoadError" bubbles=true cancelable=true eventPhase=2]

and a popup saying 'Server.Processing'.  But a few milliseconds after this, I get a UserEvent.LOAD_USER_COMPLETE event, and the user is successfully loaded.  After clicking the alert box away, everything seems to be functioning normally.

So I guess my first question is why would I get both a 'userLoadError' and a UserEvent.LOAD_USER_COMPLETE event when loading the user?  I could simpy not capture the userLoadError, but then I won't know if something really does go wrong.

If I then logout and log back in (with the same username/password), I don't ever get the userLoadError event again, but I now get 2 UserEvent.LOAD_USER_COMPLETE events thrown.  No matter how many times I log in and out now with the same user, 2 events are always thrown.  This is not really a big issue as far as I can tell - just putting it out there.

What IS a problem, is that when I logout and try to log in with a different username and password, I see that the new username and password is sent for authentication, I receive a UserEvent.AUTHENTICATION_SUCCESS event as expected, and try and load the user, but the first user I logged in with is always returned (twice) with the UserEvent.LOAD_USER_COMPLETE events.


No matter what credentials I put in now, only the first user is returned.  So it seems that the userManager.logout() functionality is not completely logging out the user from the session, even though I get a UserEvent.LOGOUT_COMPLETE before showing the login view and trying with the new user details.  This was also happening to me before I managed to completely separate the flex app from the jsp, so I don't think it's specifically related to the separation.

And the last bit of strange behaviour I'm coming across is when I close the browser tab and restart the application without clearing the cookies from the past session.  If there are session cookies in the browser, the flex config never loads (and therefore that application cannot run), returning the following error after hitting some kind of time out:


failed to load flex config:
[RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Security.Error error Error #2048: Security sandbox violation: http://localhost:8080/myproject/assetmanager/index.swf cannot load data from https://localhost:8080/myproject/messagebroker/amfsecure. url: 'https://localhost:8080/myproject/messagebroker/amfsecure'"]

This only happens if there's a previous session cookie in the browser, never on a clean run.  But as mentioned in my previous post, I don't believe that there actually is a sandbox violation, as then it would happen every time.  The only way to get around this is to clear my cookies, reload the application, and then I'm back to the start of this thread!!


Can anyone shed any light on the behaviour happening here??

Cheers,
K.