Visualforce
{!$API.Session_ID}
Documentation: $API Variable Methods
Apex
String SessId = Userinfo.getSessionID();
Salesforce Documentation:
UserInfo Methods
Note: The session ID generated in the Visualforce page will not be the same as Userinfo method.
Hi Dave – Thanks for that, I created a VF page to get my session ID and I needed to insert an underscore:
{!$Api.Session_ID}