Session Id is invalid or has expired

Issue

You run a DocGen Package and see this message:

The included Salesforce Session Id is invalid or has expired. If you continue to receive this error, please have your salesforce.com administrator verify that "Lock sessions to the IP address from which they originated" is not checked in your Salesforce security settings: Setup -> Administrative Setup -> Security Controls -> Session Settings (AuthInvalid)

Cause

You might get this error if your organization requires Lock sessions to the IP address from which they originated.

Other possible causes might be that the user generating documents logged out of Salesforce while the request was still in progress, or (potentially) multiple users generating documents were sharing credentials.

Resolution

Clear Lock sessions to the IP address from which they originated. If that doesn't work, try generating documents again, making sure no one else is generating documents using the same credentials and waiting for the request to finish. If none of these measures resolve the issue, contact support.

Clear Lock sessions to the IP address from which they originated

  1. From Setup, enter Session Settings in the Quick Find box, then click Session Settings to display the session settings for your organization.
  2. Clear Lock sessions to the IP address from which they originated.
  3. Click Save.