Solved

How to set a cookie and how to access it in diff jsp

Posted on 2008-09-30
2
216 Views
Last Modified: 2012-05-05
hi,

I am setting a cookie ,in one jsp . and retrieving in another jsp. I am unable to get that cookie in the second jsp.

Say,  I am setting in one.jsp, and retrieving in two.jsp.

In one.jsp the cookie was set..fine.. in two.jsp, its not there. If i try to access the cookie in one.jsp itself, its accessible. two.jsp is the one ,i am calling that thru Ajax and not thru form action method. Will it be a problem?


Any idea? Like do I have to mention any paths/domains .?
0
Comment
Question by:jyothisree
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 23

Accepted Solution

by:
Ajay-Singh earned 500 total points
ID: 22611361
Yes, those 2 jsps should be on the same domain, you setDomain method to set a common domain
0
 

Author Comment

by:jyothisree
ID: 22611803
ya...i kept... setDomain and setPath both..then it worked..thanks
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

687 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question