function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Flex Development: "Random" Invalid Session ID, Illegal Session Error



We have a very successful Flex application operating in an 900 person call center environment.


We have built a Flex application that is launch from an S-control on a standard layout, which receives the current user's Session ID/URL, and a number of other parameters.


The Flex application uses this data to query back to SFDC for configuration and typical account/case data.


This seems to work without issue, AT FIRST.  But, randomly as the user is interacting with our application and gets to the point of making another query/api call to SFDC they will get the Invalid Session ID/Illegal Session error.


Some debugging/testing has shown that this SFDC Session ID will "just change", even though the user has not logged out and is still able to interact with SFDC seamlessly (not making it a very good session ID, or a really poor choice of naming).


Why in the world does SFDC behave like this, and more importantly, does anyone have any code/patterns they can offer to make our Flex code more robust, to handle this problem seemlessly without the user realizing that we have to get the new session ID and relogin to the API?  Has anyone done this.


Please help!




C'mon, I know someone out there has had this problem -- and I know that a SFDC developer should be able to offer insight -- good or bad -- about why the platform is behaving this way.




Hey Dave,


We just saw this for this first time with a user of one of our Flex applications.  I'll do some digging and see if I can find anything.




Great, thanks!


For your information, some of the things that we have done to help (but not fix) this problem include:

  • Our Flex application automatically "switches" accounts that are being viewed whenever the SFDC Account, Case, or Oppty page is changed to a different account context.  We now re-establish the connection in Flex everytime the account context is changed.
  • I recently updated the API from 13 to 15.  I don't know if this has actually made any improvement, as I have to rely on user reports


Let's keep each other posted.