hi @pixislinger
can you check the path in the application cookies browser .Since you have not set it explicitely it would take the current path
You can set the path like below
cookie.setPath("/");Then try accessing the servlet it should come up .
Also use the below snippet in case you want to iterate over the cookies and see if its coming
// extracted helper method
private Cookie getCookie(HttpServletRequest request, String cookieName) {
if (StringUtils.isBlank(cookieName)) {
return null;
} else {
Cookie[] cookies = request.getCookies();
if (cookies == null) {
return null;
} else {
if (cookies.length > 0) {
Cookie[] var3 = cookies;
int var4 = cookies.length;
for(int var5 = 0; var5 < var4; ++var5) {
Cookie cookie = var3[var5];
if (StringUtils.equals(cookieName, cookie.getName())) {
return cookie;
}
}
}
return null;
}
}
}
https://sourcedcode.com/blog/aem/get-cookie-example-of-aem-servlet-and-sling-model
Hope it helps