[opencms-dev] Cookies

Urich, Chase ChaseUrich at letu.edu
Mon May 12 21:58:01 CEST 2003


I know this should be a simple task, however, I have tried every example
I can find on two different servers running OpenCMS 5.0.0 with Tomcat
(4.1.something_new). There are no error messages, warning messages, or
anything for that matter. The only cookie ever displayed by the
following code is the session cookie ...

<%@ page import="javax.servlet.http.Cookie" %>
<%
	Cookie cookie = new Cookie ("cookieName", "cookieValue");
	cookie.setMaxAge(365 * 24 * 60 * 60);
	response.addCookie(cookie);

	Cookie cookies [] = request.getCookies ();
	for (int i = 0; i < cookies.length; i++) {
		out.println(cookies[i].getName() + " -> " +
cookies[i].getValue());
	}
%>

Am I missing something? Surely this isn't a difficult task ...

Chase Urich
Web Programmer
LeTourneau University



More information about the opencms-dev mailing list