Skip to content

Instantly share code, notes, and snippets.

@arun12209
Created December 22, 2018 08:23
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/b72308d4ea76c202d5882bf83d444678 to your computer and use it in GitHub Desktop.
Save arun12209/b72308d4ea76c202d5882bf83d444678 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