• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

cookies availability?

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all, i have a question related to cookie:

if i create a cookie at www.abc.com (set path to '/') after that i create another cookies (set path to '/ext/abc'. now if the user browser www.abc.com/ext/abc/login, which cookie will probably be sent to server? first one or second one?

--------------------------------

second question:

The cookie is visible to all the pages in the directory you specify, and all the pages in that directory's subdirectories. A cookie's path must include the servlet that set the cookie, for example, /catalog, which makes the cookie visible to all directories on the server under /catalog.


above java doc quote from setPath function in HttpCookie class.

if i set cookie at www.abc.com/login, is 'login' ('login' is a servelt or jsp) needed to be included in path parameter? for example, setPath("/user") is allowed?

thanks any reply in advanced.
 
reply
    Bookmark Topic Watch Topic
  • New Topic