Example usage for com.google.gwt.user.client Cookies removeCookie

List of usage examples for com.google.gwt.user.client Cookies removeCookie

Introduction

In this page you can find the example usage for com.google.gwt.user.client Cookies removeCookie.

Prototype

public static void removeCookie(String name, String path) 

Source Link

Document

Removes the cookie associated with the given name.

Usage

From source file:org.spiffyui.client.rest.RESTility.java

License:Apache License

private static void removeCookie(String name, String currentPath) {
    Cookies.removeCookie(name, currentPath);
    if (Cookies.getCookie(name) != null) {
        /*/*from   w w w . j av  a 2 s . c  o m*/
         * This could mean that the cookie was there,
         * but was on a different path than the one that
         * we were passed.  In that case we'll bump up
         * the path and try again.
         */
        String path = currentPath;
        if (path.charAt(0) != '/') {
            path = "/" + path;
        }

        int slashloc = path.lastIndexOf('/');
        if (slashloc > 1) {
            path = path.substring(0, slashloc);
            removeCookie(name, path);
        }
    }
}