Get Session Id using Apex in Salesforce

String sessionId = UserInfo.getSessionId();