I have created cookie using document.cookie
in a jsp page.
In my servlet (remember its not a jsp page where I can use java script. Its a servlet), I am retrieving cookie value and after its use, I want to delete them. I dont want to delete the cookies by using expiry time. I want to clear off its values. So, I am doing cookie.setValue("");
But, when I check the cookie in my Browser, its still holding the value. Its not clearing off.
- How to clear off its value?
- Also, is there a way to clear off the cookie name? I know that there is no cookie.setName() function. So, any other means?
After clearing, basically I dont want a user to see the cookies in the browser.
Regards,