[opencms-dev] setting cookies in OpenCms doesn't work.
Millo Magnocavallo
millo_magno at yahoo.com
Fri Sep 17 18:56:05 CEST 2004
Hi,
Can anyone tell me why I can't set cookies in OpenCms? Do I need to
have something turned on, is there a special configuration change I
have to make? This is the following code which i've tested and works
fine in a tomcat jsp environment yet doesn't work in OpenCms:
<html>
<body>
<head><title>setting cookies</title></head>
<%
Cookie cookie = new Cookie("autoLogin","true");
cookie.setMaxAge(2147483647);
response.addCookie(cookie);
Cookie[] cookies = request.getCookies();
out.print("<br>cookies.length = " + cookies.length + "<br>");
if (cookies != null) {
for (int i=0; i < cookies.length; i++) {
out.print("<br>cookie" + i + " name:" + cookies[i].getName());
out.print("<br>cookie" + i + " value:" + cookies[i].getValue());
}
}
%>
</body>
</html>
Your help appreciated,
M
More information about the opencms-dev
mailing list