I\'m trying to get cookie in servlet using
Cookie[] cookie = request.getCookies();
but cookie is always null.
I had the same problem and discovered the cause in my case was that I was using the browser built into Eclipse. This does not accept cookies. When I accessed the same JSP from chrome, it worked. Perhaps you are doing the same thing I did?
It may also be the case that the browser you are using or your internet settings are set to reject cookies. Hope this helps you or any other visitor experiencing the same issue.