I am having the same issue as the above post described. Regardless of the checkbox "Lock sessions to the IP address from which they originated" is ticked or not, invoking DocGen generation process from a custom Lightning component or from a Detail Page Button (source ode and complete error message attached below) will always return the same error message "The included Salesforce Session Id is invalid or has expired".
Can anyone please advise any additional troubleshooting steps that we can do, or a contact whom we can reach out to have this resolved?
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 (InvalidSalesforceSessionId)