Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Information Required on Path of the Cookie

 
NareshAnkuskani Kumar
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i would like to know information on path of the cookie?Is there a possibility of cookie being sent to an web-application(namely one) that is set by some other web application(namely two) that are running in the same Server?

Thanks in Advance
A.Naresh Kumar
 
Karne Reddy
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
set the path of the cookie(using setPath.. something like this chk the API) after its creation to /. And try to get the other web app.


--------
SCJP
 
Biren shah
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.. due to javaranch internal checks..i have replace c with k and used the word kookie
There are two types of kookie,
per-session kookie and persistent kookie.
those that are per-session kookies are stored in ram-memory only.
while persistent kookies may be stored in temporary internet folder.

A kookie has a name, a single value, and optional attributes such as a comment, path and domain qualifiers, a maximum age, and a version number. Some Web browsers have bugs in how they handle the optional attributes

public String getPath method::
Returns the path on the server to which the browser returns this kookie. The kookie is visible to all subpaths on the server

so it may even be possible that paths under the same web-applicatino can not see the kookie generated by other path.
Please refer the api for javax.servlet.http.kookie for bettern understanding
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic