Question

i had written a javascript in home page component.it'll load as soon as we login to the salsforce and its working fine. but if i open Visualforce page it throws "sf:invalid code...invalid session id." How to resolve this issue. following is the session code i used in javascript.

sforce.sessionId = getCookie('sid'); sforce.connection.sessionId=sforce.sessionId;

Was it helpful?

Solution

If you want get session id, you can try to use next JS code:

var __sfdcSessionId = '{!GETSESSIONID()}';
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top