function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RiyajRiyaj 

Solve the Error: "INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session"??

hi I m using follwing c# coding.. In runtime i got error  "INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session"...

 


getClassId.getClassIdService getClassIdObj = new getClassId.getClassIdService();
getClassIdObj.SessionHeaderValue = new getClassId.SessionHeader();
getClassIdObj.SessionHeaderValue.sessionId = sessionId;


if (ddlClassname.SelectedIndex != 0)
{
string name = ddlClassname.SelectedItem.Text.ToString();

getClassId.Class__c getClassIdResponse = getClassIdObj.getClassIdFromClassname(ddlClassname.SelectedItem.Text.ToString());
Session["ClassName"] = getClassIdResponse.Name;
Session["ClassId"] = getClassIdResponse.Id;
Session["ClassDay"] = getClassIdResponse.Day_of_Week__c;
Response.Redirect("Attendance.aspx");
}
else
{
lbError.Visible = true;
lbError.Text = "You must select class name!";
}




Best Answer chosen by Admin (Salesforce Developers) 
Niket SFNiket SF

Hello Riyaj,

   If you are using the C#. In the login call you will get the Session ID in the Login Result. Please check that the SessionId that you are providing and the comes via Login Result are same.

 

Thank you 

Nik's