tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abdul Wahab" <>
Subject Cookies.
Date Mon, 08 Dec 2003 11:24:48 GMT
Hi All,

Im working with Tomcat5.0. I have problem in working with cookies. My
requirement is to save the user login info in browser cookie so that for
next time login will make easier for user to avoid entering again, like
usual login in other system.

So, I have added the cookies value in servlet, and I can get the cookie
value in jsp. When I work with the same browser fine working. But when close
and open the new browser window I cant get the cookie values.

Setting cookie,
	res.addCookie(new Cookie("entID",eID));
	res.addCookie(new Cookie("lgnId",lgnId));

After setting dispatching request and respond to the JSP page.
	Cookie[] cookies=request.getCookies();
	for (int i=0; i<cookies.length; i++) {
		hm.put(cookies[i].getName(), cookies[i].getValue());
-- this is how i get the value in same browser.
When browse this jsp in new browser getting fail to retrieve..

Can you help me to solve this issue.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message