You need to sign in to do that
Don't have an account?
Kundan Pathak
How to get sessionid in visualforce page which I am using in Salesforce Site
I have written a code to attach multiple attachment from vf page using forcetk.
The code is working fine when I am running the VF page individually
but when I am attaching the VF page in Salesforce Site the file is not attaching and its giving INVALID_SESSION_ID.
Is there any way to get SessionID in Salesfore Site.
Can anyone help..??
The code is working fine when I am running the VF page individually
but when I am attaching the VF page in Salesforce Site the file is not attaching and its giving INVALID_SESSION_ID.
Is there any way to get SessionID in Salesfore Site.
Can anyone help..??
Greetings to you!
According to Salesforce Knowledge Article (https://help.salesforce.com/articleView?id=000204984&type=1):
Before Winter 15, it was possible to get the session id for the guest user. Now, an error code saying "INVALID_SESSION_ID" is returned if you try to get the session ID of the guest user.
This change ensures that you can still create a guest user session, but doesn't allow a guest session ID to be set or created for organization security.
There are no recommended workarounds. Affected customers will need to adjust their integration to not rely on a guest user session ID.
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
try this js code,
var __sfdcSessionId = '{!GETSESSIONID()}';
Include this statement in your VF page, this will fetch the session Id based on your Org. it automatically gets the session id, I am using my page in sites also it working as excepted.
Kindly mark this as solved if the reply was helpful.
Thanks
Shaik
For my purposes, I was able to use "BrowserId" cookie - which appears to be unique for each time the browser session is started.