You need to sign in to do that
Don't have an account?
Caching the Login Session & Server
The LoginResult object currently gives back a Session ID (getSessionId) and a server (getServerUrl). The documentation mentions that for recurring access, you should cache the session ID and simply place that back onto the SOAP header. But, it fails to mention the Server URL.
How constant is the Server URL? Since it's possible to not be on the same server do I need to cache that as well? And how safe is it to cache?
Once I have both the Session and the Server cached, is there a call I can make, prior to doing my other work, to verify that it is correct? For example, will calling the getServerTimeStamp function validate my session?
Hi Curtis,
The server url has a one to one relationship with the user's salesforce.com instance. This means that as a user you are "homed" on a particular server farm, indicated by the server url. The server url will always be the same for a particular salesforce.com customer. You can cache the server url as you would the session id.
As Benji suggests, the best practice here is to cache data for the duration of the session and not across sessions. This will make your code more robust and cause less headaches if we do change the name of a particular server farm instance.