Error Handling for Session Expiration

When you sign on via the login() call, a new client session begins and a corresponding unique session ID is generated. Sessions automatically expire after the amount of time specified in the Security Controls setup area of the Salesforce application (default two hours). When your session expires, the exception code INVALID_SESSION_ID is returned. If this happens, you must invoke the login() call again. For more information about login(), see the SOAP API Developer Guide.