this code should give me cookie name , object and value of two cookies i have set , but it gives only the name,object and value of the JSESSIONID and not the other cookie i set .
Vijitha Kumara wrote:Are you saying that you are doing a forward to this page after setting the cookie(s) or something else ?
no no , i am not doing forward , i mean to say that i have set another cookie apart from "JSESSIONID " but only "JESSIONID" appears and the other one doesnot .
Vijitha Kumara wrote:Are you saying that you are doing a forward to this page after setting the cookie(s) or something else ?
no no , i am not doing forward , i mean to say that i have set another cookie apart from "JSESSIONID " but only "JESSIONID" appears and the other one doesnot .
That means the browser is not sending the other cookie(s) besides the JSESSIONID cookie? Can you explain the request flow you used to test this?
tushar panda
Ranch Hand
Joined: Feb 16, 2009
Posts: 133
posted
0
Vijitha Kumara wrote:That means the browser is not sending the other cookie(s) besides the JSESSIONID cookie?
yes
Vijitha Kumara wrote: Can you explain the request flow you used to test this?
unable to get , what do you mean by request flow .
I don't understand why you haven't posted the code, config, and URLs you're using to test this.
The way you're displaying the cookies is correct--if there should be a cookie on that page, it'll display it. Which means in all probability there isn't the cookie there you think there is. Have you confirmed the cookie physically, either by using the browser tools, or checking on the disk? Is the path right? Show us the code.
tushar panda
Ranch Hand
Joined: Feb 16, 2009
Posts: 133
posted
0
thanks for reply
David Newton wrote:I don't understand why you haven't posted the code, config, and URLs you're using to test this.
code i have posted above at the top.
url i am using is correct
i cannot get about config ??? i mean to say what is the config you are talking about , please tell me ??
David Newton wrote:Which means in all probability there isn't the cookie there you think there is.
no its there i have checked it in mozilla - tools>options>privacy>showcookies .
David Newton wrote: Have you confirmed the cookie physically, either by using the browser tools, or checking on the disk?
That's the code for *displaying* the cookies. That's not the only code being run, nor is it the only information necessary (or available) to help diagnose the problem.
tushar panda
Ranch Hand
Joined: Feb 16, 2009
Posts: 133
posted
0
sorry for a 2 day late reply
David Newton wrote:That's the code for *displaying* the cookies.
yeah i am talking about cookies , and it does not work .
David Newton wrote:That's not the only code being run
what else is required please reply ?
the code posted by me is directly taken from "Bruce perry's" book "java servlet and Jsp cookbook" ?
if its wrong then what else is required to display a cookie ?
David Newton wrote: nor is it the only information necessary (or available) to help diagnose the problem.
When you're trying to diagnose a problem, you need everything related to the problem. In addition to displaying an existing cookie, the code that creates the cookie is required. You haven't provided the information about what's in the cookie, like the path information for both the working and non-working cookies. The URL of the page being requested that you're trying to display the cookies from.
We're not in front of your machine--you have to help us to help you.
I think that probably you don't have other cookies. Of course that there are a lot of cookies in your browser, but it must belong to your site. :]
If you are running in localhost, then the cookies must be in the localhost folder.
tushar panda
Ranch Hand
Joined: Feb 16, 2009
Posts: 133
posted
0
my browser has two cookies :
first cookie :
second cookie :
the servlet code below is setting and checking cookie :
i want to get the name and value of the "regcookie" and i get it in this servlet page at line 39 and 40 , but not in the jsp page.
in the jsp page i get only the name and value of "JSESSIONID" not the "regcookie".
how can i retrieve the value of regcookie .using scriptlet it is possible but i have no luck in EL .
please help.