Hi All,
I have written a simple method to read cookie value (code below). Code works fine in author environment but breaks in publish as request.getCookies() returns null to me. I have white-listed the cookie in Opt configuration. Please can someone help what should i do to fix this.
After it works fine in publish, I hope it works in Dispatcher also.
Thanks,
Shehjad
public static String readCookieValue(final SlingHttpServletRequest request, final String name) { final Cookie[] cookies = request.getCookies(); for (final Cookie cookie : cookies) { if(cookie.getName().equals(name)){ return cookie.getValue(); } } return null; }