You need to sign in to do that
Don't have an account?
rajarak
Session_ID error in Visualforce page with AJAX toolkit
<apex:includeScript value="/soap/ajax/15.0/connection.js"/><apex:includeScript value="/soap/ajax/15.0/apex.js"/>sforce.connection.sessionId = '{!$Api.Session_ID}';
I have the above code in a visualforce page.
As per document, the AJAX toolkit supposed to handle the session Id by itself with no extra work.
But i get invalid sessionID error, if i dont set it onload of the page.
Is there something i'm missing?
Is using Controller the alternative to avoid this?
Thanks
KK
Thanks Venkat,
But my question was, Shldn't the toolkit by itself handle the session id.?
If i set the session Id on load of the page it works fine.
I was thinking that I missed something and thats why i had to explicitly set.
Or is this the way, session id needs to be handled in VF page?
All Answers
Look at the following thread:
Session_ID in AJAX
Thanks Venkat,
But my question was, Shldn't the toolkit by itself handle the session id.?
If i set the session Id on load of the page it works fine.
I was thinking that I missed something and thats why i had to explicitly set.
Or is this the way, session id needs to be handled in VF page?
Hi,
see following thread for a possible solution with invalid session IDs
Mister, r u trying with custom controller or standar ?
i cant make it work with custom controller...really nasty!!!