I am trying to check if a cookie exists on a JSP page using the Expression Language.
I have a cookie called persist which is set to either empty string
Closest what you can get is to check the cookie name in the request cookie header.
However, when there's another cookie with name foopersist, it fails.
If your container supports EL 2.2 (all Servlet 3.0 containers like Tomcat 7, Glassfish 3, etc do) then you could just use Map#containsKey().
If yours doesn't, best what you can do is to create an EL function (more concrete declaration example can be found somewhere near bottom of this answer):
with
public static boolean mapContainsKey(Map map, String key) {
return map.containsKey(key);
}