Use of custom cookies in components
It does not seem possible to set a cookie in the client browser by using the standard java Cookie class inside a component.
Consider the follow [very simple] example:
---------------------------------------------------------------------------------------------------------
Cookie mycookie = new Cookie("mycookieName", "mycookieValue");
mycookie.setMaxAge(300);
response.addCookie(mycookie);
---------------------------------------------------------------------------------------------------------
The expected behaviour of this code snippet, when added to any component, is to create a new cookie called "mycookieName" with the value "mycookieValue" in the client browser. However, no cookie is issued in either author or publisher instances.
To reproduce the issue, add the above to an AEM component, activate the page, run it in your browser and observe the developer tools to see what cookies are issued.
I would be incredibly grateful for any assistance or comments on this.