I'm using AEM 6.5.7 with HTL code in my component.And I get the
illegalStateException when I try to invoke the addCookie for my
slingHttpServletResponse in the doPost method of my servlet.Please find
the below code snippet for the same;
slingHttpServletResponse.addCookie(util.updateCookie(cookieName,
URLEncoder.encode(userName, "utf-8"), domainName,
slingHttpServletRequest));slingHttpServletResponse.addCookie(util.updateCookie("ssname",
URLEncoder.encode(businessName, "utf-8"), domainName,
sling...