How to set cookies on the entire domain name from Java Servlet? -


i have 1 servlet, located @ site.com/foo/barservlet. servlet 1 responsible setting cookies. problem is, when set cookies, path set @ /foo. mean servlets located @ site.com/someotherservlet not going able access cookies?

if so, there way set cookies on entire domain instead? if try cookie.setpath("/"), reason, when try remove cookie via cookie.setmaxage(0), has no effect , remains in place.

this problem solved doing cookie.setpath("/") both when setting, , when removing cookie. previously, doing when setting, not when removing. hence, cookie not getting removed. now, working across whole domain.


Comments