When building a composite Force.com application, it is often necessary to dynamically generate the current Session Id and API Server URL from within Visualforce and Apex.
Continued here:
Accessing Session Id and API Server URL parameters with Visualforce









