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;
If you want get session id, you can try to use next JS code: