In my AEM application I'm able to fetch the cookie (while landing the home page application) but in SlingHttpServletRequest I'm not able to get SlingHttpServletRequest.getCookie("MypropertyValue") in my dopost method. Can someone help me in looking into the issue and rectify it.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @anithara
Please check https://sourcedcode.com/blog/aem/get-cookie-example-of-aem-servlet-and-sling-model
Hi @anithara
Same issue happened with me.
What I was doing wrong was that my cookie scope was wrong i.e. when I checked my cookie was under wrong domain/path.
When I corrected the cookie domain/path, it worked fine.
Same check you can do, you can compare props for other cookies that are working fine to your
"MypropertyValue" cookie under dev tools -> application -> Storage -> cookies
Also make sure that you are not using incorrect cookie name to fetch cookie at backend.
You can try to print all cookies to debug this. ( request.getCookies() )
Hi @anithara
Please check https://sourcedcode.com/blog/aem/get-cookie-example-of-aem-servlet-and-sling-model
Views
Likes
Replies
Views
Likes
Replies