Solved

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

Posted on 2008-09-30
2
211 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

862 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now