當前位置: 首頁>>代碼示例>>Java>>正文


Java Cookies.removeCookie方法代碼示例

本文整理匯總了Java中com.google.gwt.user.client.Cookies.removeCookie方法的典型用法代碼示例。如果您正苦於以下問題:Java Cookies.removeCookie方法的具體用法?Java Cookies.removeCookie怎麽用?Java Cookies.removeCookie使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.gwt.user.client.Cookies的用法示例。


在下文中一共展示了Cookies.removeCookie方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: clearData

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
@Override
public void clearData(String dataName) {
	if (dataName == null || dataName.equals("")) return;
	
	dataName = buildPathString(dataName);
	try {
		if (dataStore != null) {
			dataStore.removeItem(dataName);
		} else {
			Cookies.removeCookie(dataName);
		}
	} catch (Exception e) {}
	initData();
}
 
開發者ID:openremote,項目名稱:WebConsole,代碼行數:15,代碼來源:LocalDataServiceImpl.java

示例2: removeCookies

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
private static void removeCookies() {
	Cookies.removeCookie( USER_LOGIN_COOKIE_NAME );
	Cookies.removeCookie( USER_SESSION_COOKIE_NAME );
	Cookies.removeCookie( USER_ID_COOKIE_NAME );
	Cookies.removeCookie( USER_PROFILE_TYPE_COOKIE_NAME );
	Cookies.removeCookie( OPENED_ROOM_IDS_COOKIE_NAME );
	//Do not remove the blocked users IDs because those can be reused
}
 
開發者ID:ivan-zapreev,項目名稱:x-cure-chat,代碼行數:9,代碼來源:SiteManager.java

示例3: removeItem

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
void removeItem(String key) {
  if (storageBackend == null) {
    Cookies.removeCookie(key);
    return;
  }
  storageBackend.removeItem(key);
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:8,代碼來源:LocalComments.java

示例4: deleteSessionCookie

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
static void deleteSessionCookie() {
  myAccount = AccountInfo.create(0, null, null, null);
  myAccountDiffPref = null;
  editPrefs = null;
  myPrefs = GeneralPreferences.createDefault();
  urlAliasMatcher.clearUserAliases();
  xGerritAuth = null;
  refreshMenuBar();

  // If the cookie was HttpOnly, this request to delete it will
  // most likely not be successful.  We can try anyway though.
  //
  Cookies.removeCookie("GerritAccount");
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:15,代碼來源:Gerrit.java

示例5: logout

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
public void logout (PageType pageType, String... params) {
	UserService userService = ApiHelper.createUserClient();

	final LogoutRequest input = setSession(
			ApiHelper.setAccessCode(new LogoutRequest()));

	userService.logout(input, new AsyncCallback<LogoutResponse>() {

		@Override
		public void onSuccess (LogoutResponse output) {
			DefaultEventBus.get().fireEventFromSource(
					new LogoutEventHandler.LogoutSuccess(input, output),
					SessionController.this);
		}

		@Override
		public void onFailure (Throwable caught) {
			DefaultEventBus.get().fireEventFromSource(
					new LogoutEventHandler.LogoutFailure(input, caught),
					SessionController.this);
		}
	});

	session = null;
	Cookies.removeCookie(COOKIE_KEY_ID);
	if (pageType != null) {
		PageTypeHelper.show(pageType, params);
	}
}
 
開發者ID:billy1380,項目名稱:blogwt,代碼行數:30,代碼來源:SessionController.java

示例6: setLocale

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
public void setLocale(String locale) {
	if (locale == null) {
		Cookies.removeCookie(LOCALE_COOKIE);
	} else {
		Cookies.setCookie(LOCALE_COOKIE, locale);
	}
}
 
開發者ID:WELTEN,項目名稱:dojo-ibl,代碼行數:8,代碼來源:LocalSettings.java

示例7: setOnBehalfOf

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
public void setOnBehalfOf(String onBehalfOf) {
	if (onBehalfOf == null) {
		Cookies.removeCookie(ON_BEHALF_OF_COOKIE);
	} else {
		Cookies.setCookie(ON_BEHALF_OF_COOKIE, onBehalfOf);
	}
}
 
開發者ID:WELTEN,項目名稱:dojo-ibl,代碼行數:8,代碼來源:LocalSettings.java

示例8: readFromCookie

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
public static OauthClient readFromCookie() {
	String accessToken = Cookies.getCookie(COOKIE_TOKEN_NAME);
	String typeString = Cookies.getCookie(COOKIE_OAUTH_TYPE);
	
	if (typeString == null || accessToken == null) {
		Cookies.removeCookie(COOKIE_TOKEN_NAME);
		Cookies.removeCookie(COOKIE_OAUTH_TYPE);
		return null;
	}
	Integer type = Integer.parseInt(typeString);
	OauthClient client = null;
	switch (type) {
	case AccountJDO.FBCLIENT:
		client = new OauthFbClient();
		break;
	case AccountJDO.GOOGLECLIENT:
		client = new OauthGoogleClient();
		break;
	case AccountJDO.LINKEDINCLIENT:
		client = new OauthLinkedIn();
		break;
           case AccountJDO.ECOCLIENT:
               client = new OauthECO();
               break;
	default:
		break;
	}
	client.accessToken = accessToken;
	return client;
	
}
 
開發者ID:WELTEN,項目名稱:dojo-ibl,代碼行數:32,代碼來源:OauthClient.java

示例9: tearDown

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
@Override
protected void tearDown() {
	Cookies.removeCookie(SESSION_COOKIE_NAME);
}
 
開發者ID:jcricket,項目名稱:gwt-syncproxy,代碼行數:5,代碼來源:XsrfProtectionTest.java

示例10: setSessionCookie

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
private static void setSessionCookie() {
  if(session != null)
    Cookies.setCookie(UserSession.SESSION_HEADER, session.getSessionString());
  else
    Cookies.removeCookie(UserSession.SESSION_HEADER);
}
 
開發者ID:KnowledgeCaptureAndDiscovery,項目名稱:ontosoft,代碼行數:7,代碼來源:SessionStorage.java

示例11: initAndShow

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
private void initAndShow() {

        // initialize JossoUtil... supply context information
        JossoUtil.init(
                Application.getInstance().getProperties().getProperty("sso.server.url"),
                GWT.getModuleBaseURL(),
                Application.getInstance().getProperties().getProperty("sso.user.profile.url")
        );

        commandTable = creator.makeCommandTable();
        toolBar = creator.getToolBar();
        layoutManager = creator.makeLayoutManager();
        if (creator.isApplication()) {
            requestHandler = getRequestHandler();
            History.addValueChangeHandler(requestHandler);
        }


        nullFrame = new Frame();
        nullFrame.setSize("0px", "0px");
        nullFrame.setVisible(false);

        RootPanel root = RootPanel.get();
        root.clear();
        root.add(nullFrame);
        if (BrowserUtil.isTouchInput()) root.addStyleName("disable-select");

        if (getLayoutManager()!=null) getLayoutManager().layout(creator.getLoadingDiv());

        checkMobilAppInstall();

        if (SupportedBrowsers.isSupported()) {
            if (appReady != null) {
                appReady.ready();
            }

            if (creator.isApplication()) {
                // save the current state when you leave.
                DeferredCommand.addCommand(new Command() {
                    public void execute() {
                        Window.addCloseHandler(new CloseHandler<Window>() {
                            public void onClose(CloseEvent<Window> windowCloseEvent) {
                                gotoUrl(null, false);
                            }
                        });
                    }
                });

                // coming back from prior session
                String ssoBackTo = Cookies.getCookie(PRIOR_STATE);
                final Request prevState = Request.parse(ssoBackTo);
                if (prevState != null && prevState.isSearchResult()) {
                    Cookies.removeCookie(PRIOR_STATE);
                    History.newItem(ssoBackTo, true);
                } else {
                    // url contains request params
                    String qs = Window.Location.getQueryString().replace("?", "");
                    if (!StringUtils.isEmpty(qs) && !qs.contains(IGNORE_QUERY_STR)) {
                        String qsDecoded = URL.decodeQueryString(qs);
                        String base = Window.Location.getHref();
                        base = base.substring(0, base.indexOf("?"));
                        String newUrl = base + "#" + URL.encodePathSegment(qsDecoded);
                        Window.Location.replace(newUrl);
                    } else {
                        String startToken = History.getToken();
                        if (StringUtils.isEmpty(startToken)) {
                            goHome();
                        } else {
                            requestHandler.processToken(startToken);
                        }
                    }
                }
                if (backgroundMonitor!=null) backgroundMonitor.syncWithCache(null);
            }
        } else {
            hideDefaultLoadingDiv();
            SupportedBrowsers.showUnsupportedMessage();
        }


    }
 
開發者ID:lsst,項目名稱:firefly,代碼行數:82,代碼來源:Application.java

示例12: removeSession

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
/**
 * 
 */
public void removeSession () {
	Window.get().setSession(null);
	session = null;
	Cookies.removeCookie(COOKIE_KEY_ID);
}
 
開發者ID:billy1380,項目名稱:blogwt,代碼行數:9,代碼來源:SessionController.java

示例13: loadStorage

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
protected boolean loadStorage() {

		boolean result = false;

		if (Storage.isLocalStorageSupported()) {
			Storage storage = Storage.getLocalStorageIfSupported();

			Collection<String> cookies = null;

			if (Cookies.isCookieEnabled()) {
				cookies = Cookies.getCookieNames();
			}

			for (Field f : getFields()) {
				String value = storage.getItem(f.name);

				if (value != null) {
					// do nothing
				} else if ((cookies != null) && (cookies.contains(f.name))) {
					value = getCookie(f.name, f.defaultValue);
					storage.setItem(f.name, value);
					Cookies.removeCookie(f.name);
				} else {
					value = f.defaultValue;
					storage.setItem(f.name, value);
				}

				setFieldValue(f, value);
			}

			result = true;
		}

		return result;
	}
 
開發者ID:dawg6,項目名稱:dhcalc,代碼行數:36,代碼來源:BasePanel.java

示例14: disAuthenticate

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
public static void disAuthenticate() {
	oauthInstance = null;
	Cookies.removeCookie(COOKIE_TOKEN_NAME);
	Cookies.removeCookie(COOKIE_OAUTH_TYPE);
}
 
開發者ID:WELTEN,項目名稱:dojo-ibl,代碼行數:6,代碼來源:OauthClient.java

示例15: onError

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
@Override
	public void onError() {
//		Authoring.loginIncorrect();
		Cookies.removeCookie(AUTH_COOKIE);		
		Cookies.removeCookie(USERNAME_COOKIE);		
	}
 
開發者ID:WELTEN,項目名稱:dojo-ibl,代碼行數:7,代碼來源:Authentication.java


注:本文中的com.google.gwt.user.client.Cookies.removeCookie方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。