How to set httponly to the cookie from sling servlet and why the used version of javax.servlet is 2.5?
I add cookie to the SlingHttpServletResponse by using code:
String accessToken = objectResult.getString("access_token");
Cookie responseCookie = new Cookie("web-token", accessToken);
responseCookie.setMaxAge(1000);
responseCookie.setPath("/");
response.addCookie(responseCookie);
When I want to add responseCookie.setHttpOnly, there is error because the version of javax.servlet in AEM (It's version 2.5) doesn't have that method.
I tried to update the version in the parent pom.xml file, but I got error
Could not resolve dependencies for project id.jeffersonsetiawan.aem:training.core:bundle:1.0-SNAPSHOT: Failure to find javax.servlet:servlet-api:jar:3.1 in http://repo.adobe.com/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of adobe has elapsed or updates are forced
I tried to use responseCookie.setPath("/; HttpOnly;");, It's working, but now I can't set path to the root of my site ('/').
Please help.