Sathish David Kumar N
asked on
Problem in session
HI ,
I have created a application . in the login screan i put that user name in session. my application is working fine before calling web services .
while i am calling web services i set some values in cokkies , for session id creation .
after successfull call of web services all session value are null ?
i dont know why ??
this two method only call for session creation is this problem .
or iam seeting httpConnection property for cokkies as fasle?
which one is the problem ?l
I have created a application . in the login screan i put that user name in session. my application is working fine before calling web services .
while i am calling web services i set some values in cokkies , for session id creation .
after successfull call of web services all session value are null ?
i dont know why ??
private static String getCookieFromHeaders(HttpURLConnection wsConnection) {
String headerValue = "FAIL";
int i = 0;
do {
String headerName = wsConnection.getHeaderFieldKey(i);
if (headerName != null && headerName.equals("Set-Cookie")) {
headerValue = wsConnection.getHeaderField(i);
break;
}
i++;
} while (true);
return headerValue;
}
private static void setSessionIdFromCookie(String sessionString) {
int jsessionIdx = 0;
jsessionIdx = sessionString.indexOf("jsessionid=");
if (jsessionIdx >= 0) {
sessionString = sessionString.substring(jsessionIdx);
setSessionId(sessionString.substring(11, sessionString.indexOf(";")));
}
}
this two method only call for session creation is this problem .
or iam seeting httpConnection property for cokkies as fasle?
which one is the problem ?l
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER