I have tried getting cookie from javascript to servlet using
request.getcookie()
method. But I found the value as null.
Is there any way to get a cookie from javascript to servlet?
try this
Cookie[] cookies = request.getCookies();
for (int i = 0; i < cookies.length; i++) {
Cookie c = cookies[i];
c.getName() //cookie name
c.getValue() //cookie value
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With