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
Solved

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

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
servlet requestdispatcher include and forward differences 1 39
jsp login check 12 43
difference between sorce folder and folder in eclipise 3 29
jsp error 6 26
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…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
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…
This video teaches viewers about errors in exception handling.

829 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