Skip to content
Advertisement

Get cookie value in java

I’ve initialized cooke like this in my JSP,

JavaScript

So, all the cookies created will have the same name, but different value for different user access time.

At the ending of java servlet I want to deactivate/kill the cookie that has been passed at the beginning of java servlet and say if they are 5 users using the system in parallel how will I know which cookie to deactivate for which user in the last of my.java?

for example, consider

JavaScript

Now, at the end of my.java servlet I want to deactivate the cookie with value CCC that has been assigned at the beginning of my.java without disturbing other cookie values, how to do this?

Advertisement

Answer

You are using the wrong method for reading the cookies..

JavaScript

use this. No need to detect the cookie for particular user just deactivate it.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement