Here is how I did it. url_ is a URL.
sessionCookie_ is something like "jsessionid=ekjhdsus01".
You get the session cookie with session.getId();
HttpURLConnection dataCon = null;
dataCon = (HttpURLConnection) url_.openConnection();
// Set up the connection to be POST, do output, and set the session cookie
dataCon.setDoOutput(true);
dataCon.setRequestMethod("POST");
if (sessionCookie_ != null) {
dataCon.setRequestProperty("Cookie", sessionCookie_);
}
OutputStream out = dataCon.getOutputStream();
...
Hi,
I cannot answer to your question, but I have a question for you.
I don't know much about jsessionid.
you pass it thru the URL like that 1)www.mysite.com/page.jsp;jsessionid=123
2)123 = is session.getId?
3) In the page called (page.jsp), do I have to put some code to make the session associate with the pass one (querystring or something)?
4) May I pass jsessionid via an URL in a jsp or it is limited to servlet?
Great thanks!