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:com.extjs.gxt.ui.client.state.CookieProvider.java

License:sencha.com license

protected void clearKey(String name) {
    Cookies.removeCookie(name, path);
}

From source file:com.ponysdk.core.terminal.ui.PTCookies.java

License:Apache License

@Override
public boolean update(final ReaderBuffer buffer, final BinaryModel binaryModel) {
    final ServerToClientModel model = binaryModel.getModel();
    if (ServerToClientModel.ADD_COOKIE == model) {
        final String name = binaryModel.getStringValue();
        // ServerToClientModel.VALUE
        final String value = buffer.readBinaryModel().getStringValue();

        final BinaryModel expireModel = buffer.readBinaryModel();
        final Date expirationDate;
        if (ServerToClientModel.COOKIE_EXPIRE == expireModel.getModel()) {
            expirationDate = new Date(expireModel.getLongValue());
        } else {//from   w  w w .  j  a va2 s.  co m
            expirationDate = null;
            buffer.rewind(expireModel);
        }

        final BinaryModel domainModel = buffer.readBinaryModel();
        final String domain;
        if (ServerToClientModel.COOKIE_DOMAIN == domainModel.getModel()) {
            domain = domainModel.getStringValue();
        } else {
            domain = null;
            buffer.rewind(domainModel);
        }

        final BinaryModel pathModel = buffer.readBinaryModel();
        final String path;
        if (ServerToClientModel.COOKIE_PATH == pathModel.getModel()) {
            path = pathModel.getStringValue();
        } else {
            path = null;
            buffer.rewind(pathModel);
        }

        final BinaryModel secureModel = buffer.readBinaryModel();
        final boolean secure;
        if (ServerToClientModel.COOKIE_SECURE == secureModel.getModel()) {
            secure = true;
        } else {
            secure = false;
            buffer.rewind(secureModel);
        }

        Cookies.setCookie(name, value, expirationDate, domain, path, secure);

        return true;
    } else if (ServerToClientModel.REMOVE_COOKIE == model) {
        final String name = binaryModel.getStringValue();
        final BinaryModel path = buffer.readBinaryModel();
        if (ServerToClientModel.COOKIE_PATH == path.getModel()) {
            Cookies.removeCookie(name, path.getStringValue());
        } else {
            buffer.rewind(path);
            Cookies.removeCookie(name);
        }
        return true;
    } else {
        return super.update(buffer, binaryModel);
    }
}

From source file:edu.caltech.ipac.firefly.ui.GwtUtil.java

/**
 *
 * @param url//from   ww w.  ja  v  a 2 s. c o  m
 * @param checkIntvlInMsec check interval in milliseconds
 * @param maxTries
 * @param confirmationCallback
 */
public static void submitDownloadUrl(String url, int checkIntvlInMsec, final int maxTries,
        final Command confirmationCallback) {
    if (checkIntvlInMsec > 0 && maxTries > 0 && confirmationCallback != null) {
        Frame f = Application.getInstance().getNullFrame();
        final String codId = String.valueOf(System.currentTimeMillis());
        url += (url.contains("?") ? "&" : "?") + COD_ID + "=" + codId;
        f.setUrl(url);
        Scheduler.get().scheduleFixedDelay(new Scheduler.RepeatingCommand() {
            int tries = 0;

            public boolean execute() {
                String c = Cookies.getCookie(COD_ID);
                tries++;
                if ((c != null && c.equals(codId)) || tries > maxTries) {
                    Cookies.removeCookie(COD_ID, "/");
                    confirmationCallback.execute();
                    return false;
                } else {
                    return true;
                }
            }
        }, checkIntvlInMsec);
    } else {
        showDebugMsg("InvalidArgumentException: submitDownloadUrl");
    }
}

From source file:net.meddeb.md.admin.client.MenuLauncher.java

License:Open Source License

private void clearMenu() {
    String moduleTag = "/" + MODULEID + "/";
    Cookies.removeCookie(MENUTAG, moduleTag);
}

From source file:net.meddeb.md.admin.client.MenuLauncher.java

License:Open Source License

private void setLoggedout() {
    String moduleTag = "/" + MODULEID + "/";
    Cookies.removeCookie(SESSIONTAG, moduleTag);
}

From source file:org.ednovo.gooru.shared.util.StringUtil.java

License:Open Source License

public static void clearCookies(String key, String path, String domain) {
    Cookies.setCookie(key, "", new Date(), "." + Window.Location.getHost(), path, false);
    Cookies.removeCookie(key, "/");
}

From source file:org.jahia.ajax.gwt.client.widget.content.ContentExport.java

License:Open Source License

private void startProgress(ProgressBar progressBar, final GWTJahiaNode n) {
    progressBar.setIncrement(50);/* w w w .  j  a va2 s .  co m*/
    progressBar.auto();
    new Timer() {
        @Override
        public void run() {
            String exportedNode = Cookies.getCookie("exportedNode");
            if (exportedNode != null && exportedNode.equals(n.getUUID())) {
                hide();
                Cookies.removeCookie("exportedNode", "/");
                this.cancel();
            }
        }
    }.scheduleRepeating(1000);
}

From source file:org.obiba.opal.web.gwt.rest.client.RequestCredentials.java

License:Open Source License

public void invalidate() {
    Cookies.removeCookie(OPALSID, "/");
}

From source file:org.sigmah.client.security.AuthenticationProvider.java

License:Open Source License

/**
 * <p>/*  w ww .j av  a  2 s  .  c  o m*/
 * Clears the current authentication (cookies + cached authentication data).
 * </p>
 * <p>
 * Maintains the {@link Language} previously set.
 * </p>
 * 
 * @return {@code true} if the authentication has been successfully cleared.
 */
public boolean clearAuthentication() {

    Cookies.removeCookie(org.sigmah.shared.Cookies.AUTH_TOKEN_COOKIE, org.sigmah.shared.Cookies.COOKIE_PATH);
    // TODO Also clear GXT theme cookie?

    authentication = new Authentication(authentication.getLanguage());

    return true;
}

From source file:org.sigmah.client.SigmahAppFrame.java

License:Open Source License

private void logOut() {
    Cookies.removeCookie(org.sigmah.shared.Cookies.AUTH_TOKEN_COOKIE, "/");
    Window.Location.reload();
}