Hi
I am having problem in reading cookies( send from the server) in an Applet.
I am URLConnection.getRequestProperty("set-cookie")/("cookie") and both of
them are returning null. Also is doing
URLConnection.setRequestProperty("cookie",value) the right way for setting
cookies when the Applet requests something from the webserver/servlet??.
Is there anyway of setting the cookie the Applet got from the server in the
browser??
I am having a Login Applet which sends a GET request to the LoginServlet in
the from of an URL and I just do getAppletContext().showDocument(URL). As
far as I know the getApletContext().showDocument(url) requests the browser
to load the url --- so it is expected the browser should pick up the cookie
set by the server/LoginServlet. But it is not doing so ( Tested in both NN
4.6 and IE4.0). And hence the subsequent requests are getting redirected to
the first Login page as there is no session ( I have put that check to
redirect in case no session is there for security).
When the LoginApplet sends the get request this is what I do in my
LoginServlet ---
HttpSession session = req.getSession(true);
to initialize the session. This servlet throws a html page which the
LoginApplet displays by getAppletContext().showDocument(URL). Subsequent
requests from that page are failing as the browser does not have the cookie
and all the subsequent servlets are having an initial check of this
form ------------------
if( request.getSession(false) == null)
response.sendRedirect("Login.html");//the user has not logged in
Has anybody faced similar problem or am I doing something wrong??
TIA
Anamitra
___________________________________________________________________________
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