Hi,
I am writing a servlet handler program. The process is: when user login, my
handler servlet read login information and pass them to loginServlet, save
loginServlet's sessionId and display result. Then user can edit his account
through Get method of 'updateServlet '. My handler servlet will pass
loginServlet's sessionId to updateServlet.
But when I use req.getSession(true) in updateServlet, what I got is
different with the sessionid i sent. Please help me.
Here is my code:
handlerServlet:
public sendGetData(String lastCookie)
{
URL url=new URL("/servlet/updateServlet?Change=add");
URLConnection con = url.openConnection();
con.setDoInput(true);
con.setUseCaches(false);
if(lastCookie!=null)
con.setRequestProperty("cookie", lastCookie);
InputStream in = con.getInputStream();
Reader reader = new InputStreamReader(in);
this.reader = new BufferedReader(reader);
}
updateServlet:
doGet()
{
HttpSession session=req.getSession(true) ;
String sessionId=session.getId();
....
}
Thanks in advance
rachel
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html