Where do all the cookies go?

Could someone please tell me how cookies are scoped and managed? I have a web application, implemented with Tomcat, and in some parts of the application I can get cookies, and in others not. The header HOST value is the same (I've printed it out), so I don't know how to get at these cookies.

What I'm trying to do is implement an autologin type feature. When the user logs on manually (via a page like "http://host.com/login.jsp"), the user is validated via a database lookup in a servlet and userid/password cookies are stored (by this servlet, with a uri in the jsp's form like "/appname/ManualLogin"). The login.jsp page populates the form fields (${cookie.userid.value}) from the cookies with no problem. At logon, a user bean is stored. When the user goes to an internal page (like "http://host.com/UserData/userid/home.jsp"), if the user bean is not set, he will be redirected to an autologin servlet (from the jsp page, this is <jsp:forward page="/AutoLogin" />. This servlet attempts to get the userid/password cookies from the request. The autologin servlet does not see the cookies.

Any ideas where these cookies went and how I can get them from my autologin servlet?

TIA,

anw

[1225 byte] By [anw1652a] at [2007-11-27 11:21:13]
# 1

OK, evidently where I was setting the cookies grabbed a default path for the cookies. When I set the cookies and explicitly set a path of "/" (Cookie.setPath("/")), they are all available.

Thanks to anyone who may have looked at this.

Regards,

Allen

anw1652a at 2007-7-29 14:47:24 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Storing userids and passwords in a cookie is bad practice. Rather generate a long and unique ID string.

BalusCa at 2007-7-29 14:47:24 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...