Solved

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

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

743 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

12 Experts available now in Live!

Get 1:1 Help Now