[jboss-user] [JBoss Portal] - New Session Id generated on every AJAX call when SSL is enab

cybershastri do-not-reply at jboss.com
Mon Jan 7 15:11:24 EST 2008


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;
  |   		req.send(params);
  |   	}
  | 

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;
  | }
  | 

Regards,
Shastri.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117704#4117704

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4117704



More information about the jboss-user mailing list