2 Replies Latest reply on Jan 9, 2008 6:00 PM by Sohil Shah

    New Session Id generated on every AJAX call when SSL is enab

    Shrinidhi Shastri Newbie

      Hi All,

      I am making an AJAX call in one of my jsp pages.
      When I login to the portal with normal HTTP url, and make the AJAX call,
      the session Id for the AJAX request remains the same everytime.
      However, the behavior changes when I login to portal with HTTP/S protocol.
      Now, everytime the AJAX request generates new session id. Is this normal behavior? What needs to be done if I need the same session id to be used for each AJAX request?

      Here is how I am creating AJAX requests :

       function updateTicket(){
       var params;
       // Obtain an XMLHttpRequest instance
       req = newXMLHttpRequest();
       var handlerFunction = callback;
       params = "ticketNumber=" + ticketNumber + "&"
       + "probDesc=" + eprobdesc + "&"
       + "diagResoln=" + ediagres + "&"
       + "requestType=updateTicket";
       var url="/TicketEscalation/TicketUpdate.json";
       req.open("POST", url , true);
       req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
       req.setRequestHeader("Content-length", params.length);
       req.setRequestHeader("Connection", "close");
       req.onreadystatechange = handlerFunction;

      function newXMLHttpRequest() {
       if (window.XMLHttpRequest) {
       // Create XMLHttpRequest object in non-Microsoft browsers
       req = new XMLHttpRequest();
       } else if (window.ActiveXObject) {
       // Create XMLHttpRequest via MS ActiveX
       try {
       // Try to create XMLHttpRequest in later versions
       // of Internet Explorer
       req = new ActiveXObject("Msxml2.XMLHTTP");
       } catch (e1) {
       // Failed to create required ActiveXObject
       try {
       // Try version supported by older versions
       // of Internet Explorer
       req = new ActiveXObject("Microsoft.XMLHTTP");
       } catch (e2) {
       // Unable to create an XMLHttpRequest with ActiveX
       alert("Your browser does not support AJAX");
       return req;