I cannot access client code. This all needs to be from within the servlet. Surely this must be possible.
Incidently after creating the cookie, when I do a getPath or a getDomain I just get null back. Is this expected?
User Profile
Collapse
-
so request.getCook ies() gets cookies from the client? Then how do I save cookies to the client if response.addCoo kie() saves it in the server. Can't I save cookies to the client from within the servlet. I would've hoped this would be possible as otherwise I can't see how useful the cookies API can be.Leave a comment:
-
I'm not going to relent. I really really really need help on this. Somebody must know!Leave a comment:
-
-
No. I have done it that way so that first time round it won't find the cookie. However, when the method is entered the second time, shouldn't it find the cookie then? It doesn't seem to at the moment... And I've checked my "temporary internet files" folder to see if it's there, but it isn't.Leave a comment:
-
The java servlet is being run from a UNIX platform. And I'm accessing the page that references the servlet from an NT machine. The page contains a link to a cgi-script and the cgi-script sends an HTTP request to the Java servlet.
Further, when I run getDomain() and getPath() on the cookie I create in the above code I just get null for the two. But using setDomain and setPath to correct this doesn't seem to help.Leave a comment:
-
Storing Cookies in a Java servlet
Hi,
I am updating a Java servlet to store cookies. The class inherits from HttpServlet and overrides the "service" method. Within this method I have the following code to test cookie storing and retreival:
public void service( HttpServletRequ est req, HttpServletResp onse res ) throws IOException
{
......
Cookie[] cookies = req.getCookies( );
if( cookies != null )
{
...
No activity results to display
Show More
Leave a comment: