• Hazem Lotfy
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

When redirecting to a page and passing the session as a parameter using UserInfo.getSessionId() I am getting invalid session id. This was working last week.

here is the apex code:

private String buildFP_URL()

    {
        String serverUrl = 'https://' + ApexPages.currentPage().getHeaders().get('Host') + '/services/Soap/u/15.0/' + UserInfo.getOrganizationId().substring(0, 15);
        String sessionId = UserInfo.getSessionId();
        String oName = opp.Name;
       
        String encodedOname = EncodingUtil.urlEncode(oName , 'UTF-8');
        String fpServer = 'https://sbx.fpx.com';     
        return fpServer +'/login/connect.do?destination=quote"eName=' + encodedOname+ ' Quote&SfdcOpId=' + opp.Id + '&SfdcOpName=' + encodedOname+ '&SfdcServerURL=' + serverUrl + '&SfdcSessionID=' + sessionId;
       

is there a reason why the call UserInfo.getSessionId() would not return a valid session.

When redirecting to a page and passing the session as a parameter using UserInfo.getSessionId() I am getting invalid session id. This was working last week.

here is the apex code:

private String buildFP_URL()

    {
        String serverUrl = 'https://' + ApexPages.currentPage().getHeaders().get('Host') + '/services/Soap/u/15.0/' + UserInfo.getOrganizationId().substring(0, 15);
        String sessionId = UserInfo.getSessionId();
        String oName = opp.Name;
       
        String encodedOname = EncodingUtil.urlEncode(oName , 'UTF-8');
        String fpServer = 'https://sbx.fpx.com';     
        return fpServer +'/login/connect.do?destination=quote"eName=' + encodedOname+ ' Quote&SfdcOpId=' + opp.Id + '&SfdcOpName=' + encodedOname+ '&SfdcServerURL=' + serverUrl + '&SfdcSessionID=' + sessionId;
       

is there a reason why the call UserInfo.getSessionId() would not return a valid session.