function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kendric B. EvansKendric B. Evans 

Posting to a managed visualforce page fails the first time

We're developing an app and switched from using GETs with long URLs to POSTs to overcome limitations with large numbers of records.  Our managed app refers to other managed apps (some of which we wrote) in order to extend the functionality.  When we try to send a post to that other app (which, being managed, is on a different subdomain), the request is redirected a few times, first to "ourInstance.salesforce.com/visualforce/session" with the url attached, then "destinationNamespace.ourInstance.visual.force.com/visualforce/recsession" before finally redirecting back to the requested page.  I believe that this redirect chain is to properly handle the session handoff because once the session cookie is set, it doesn't do it again.

This wouldn't be a problem, except that it converts from a POST to a GET by the end.  This means that the first time you use this app from our app, it appears to have ignored your selection.  This is somewhat frustrating for us as we have had to implement a workaround where we requested a resource file from the destination app during the initialization of our javascript so that it handles the session and subsequent requests work as anticipated.

The workaround is klugy and wasteful, but effective.  We are curious as to whether anyone else is struggling with this and if Salesforce is aware of it.  I don't know when it started because we didn't switch to POSTs until after Summer '14.

 

James EstevezJames Estevez
We're experiencing similar behavior with a ListView button that uses StandardSetController.getSelected() to retrieve records from a related list. Disabling the Enhanced Session ID Management for Visualforce critical update resolved the issue for us. There is at least one other question on this forum related to this issue, but I'm not sure if Salesforce is aware.