Not able to read cookie value from request object in AEM as Cloud without query param
Hi,
I have this logic to read the cookies
Optional<Cookie[]> cookies = Optional.ofNullable(request.getCookies());
if (cookies.isPresent()) {
return Arrays.stream(cookies.get()).filter(cookie -> cookie.getName().equals(cookieName))
.map(cookie -> cookie.getValue()).findFirst();
}
return Optional.empty();
Now the problem is If i hit my page URL from akamai or AEM Publish URL without query param then i am not able read cookie value but if i hit same URL with query param then i am getting correct response. Let my cookie name is ABC and its present in both the cases : with query param and without query param. Also this issue is only happening in one environment and not in other. Is there any configuration which blocks request object to get the cookies?? Because i faced a similar issue where i am not able to read the i18n values until and unless i dont pass query param in URL. Here the main issue is about reading the cookies which i am not able to read if i dont pass some query param even though the cookie is present
