Session ID with API 40 — Salesforce 365


Salesforce has stopped displaying “SessionId” on the Debug Log from Summer 17 (API 40) from security point of view. Until API 39, “System.debug(UserInfo.getSessionId())” was used to get SessionId. The Dev console is going to print “SESSION_ID_REMOVED” going forward.

We can still get the SessionId by using 2 UserInfo methods as below:

=================================================================== System.debug(UserInfo.getOrganizationId()+”+UserInfo.getSessionId().SubString(15)); ==================================================================

In the above line of code, SessionId is concatenated with OrganizationId (the first 15 digits of SessionId/access_token) which transforms into SessionId.

Session id with API 40

via Session ID with API 40 — Salesforce 365

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s