You need to sign in to do that
Don't have an account?

Invalid 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.
We are aware of this problem and apologize. The fix for this should be released by Wednesday the 28th of September. I can't guarantee the date, but hopefully it's sooner rather than later.
Again, apologies.
All Answers
We had this issue yesterday, its down to the Winter 12 release I think.
The UserInfo.SessionID doesn't work, you need to use $API.Session_id from within Visualforce to get teh 'right' Session Id. I'm unsure if thats a bug or a feature.
I'm experiencing a timeout because of this. It is only happening in our Winter '12 full sandbox. All is still good in our Summer '11 dev sandbox. Ticket has been created with SFDC....
At SFDC Status all future maintenance windows have disappeared. I'm assuming we're waiting for Winter '12.1 to get this issue fixed.
We are aware of this problem and apologize. The fix for this should be released by Wednesday the 28th of September. I can't guarantee the date, but hopefully it's sooner rather than later.
Again, apologies.
Can we please know the work-around if Userinfo.getSessionId() is not bieng used in VF, but in the Apex classes itself for sending a request to an integrated service ? like in the original post from Hazem.
here is what i did as a workaround, i passed the session as a parameter and in the constructor of the class i grabed the session like this:
session = ApexPages.currentPage().getParameters().get('session');
hope that helps
Our ticket was just marked as resolved. We tested our Drawloop implementation in Winter '12 and everything is working like magic again.
We couldn't use a workaround as we were not using visualforce, only apex. We're continuing to test but so far so good!