Skip to content

Instantly share code, notes, and snippets.

@arun12209
Created June 23, 2019 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arun12209/cdd18a972cee631d40a3538b12ee07f3 to your computer and use it in GitHub Desktop.
Save arun12209/cdd18a972cee631d40a3538b12ee07f3 to your computer and use it in GitHub Desktop.
UtilsClass
global class UtilsClass {
global static String getSessionIdFromVFPage(PageReference visualforcePage){
String content = visualforcePage.getContent().toString();
Integer s = content.indexOf('Start_Of_Session_Id') + 'Start_Of_Session_Id'.length(),
e = content.indexOf('End_Of_Session_Id');
system.debug('Session ID: ' + content.substring(s, e));
return content.substring(s, e);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment