function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
kvm1231kvm1231 

"USER_DEBUG [1]|DEBUG|--SESSION_ID_REMOVED"

Hi,

I am trying to generate the Session Id through Developer console, but i getting "USER_DEBUG [1]|DEBUG|--SESSION_ID_REMOVED" message.

Before it was working fine with below same line of code

system.debug('--'+Userinfo.getSessionId());

Please let me know what is the issue, why now i can't able to generate the Session id.

Thanks in advance

KVM
HARSHIL U PARIKHHARSHIL U PARIKH
I have found similar question here if it helps you though..
https://developer.salesforce.com/forums/?id=906F00000009QG6IAM
 
Mahesh AdiMahesh Adi

Not sure why but I feel for security reasons, salesforce has stopped the printing of session id in debug logs (Summer 17). Seems with a request, it can be avaialble.

We can get using Apex or Visualforce find below

Apex:

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


Visualforce:​

<apex:page>
{!$Api.Session_ID}
</apex:page>