Need help w/ getting session ID/Information.
I have the following code in a servlet that is sitting on the external web
server. I am using a URL Scraper channel to access the servlet. I have
modified the extrnal web servers servlets.properties file and
rules.properties to know about the servlet.
try {
Cookie[] cookies = request.getCookies();
for (int i=0;i<cookies.length; i ++ ) {
System.out.println("**** Cookie: " + cookies.getName());
}
SessionID sid = new SessionID(request);
if (sid.getRandomString() != null || sid.getRandomString() != "") {
System.out.println("**** Session ID: " + sid.toString());
Session sess = Session.getSession(sid);
int state = sess.getState(false);
if (state != Session.VALID) {
System.out.println("%%%%% Session Not Valid %%%%%");
} else {
Profile p = sess.getUserProfile();
System.out.println("**** Got Profile ****");
String office2 =
p.getAttributeString("LocalOffice-localOffice");
System.out.println("**** Local-Office: " + office2);
}
}
} catch ( com.iplanet.portalserver.session.SessionException se) {
System.out.println("%%%%% Session Exception: " + se);
} catch ( com.iplanet.portalserver.profile.ProfileException pe) {
System.out.println("%%%%% Profile exception: " + pe);
}
I get the iPlanetPortalServer cookie, and I get a print of: **** Session ID:
But then I get a session exception. From all the code that I have seen on
how to do this mine is very similar. Does anyone know what I am doing wrong?>

