本文整理匯總了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();
}
示例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
}
示例3: removeItem
import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
void removeItem(String key) {
if (storageBackend == null) {
Cookies.removeCookie(key);
return;
}
storageBackend.removeItem(key);
}
示例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");
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例9: tearDown
import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
@Override
protected void tearDown() {
Cookies.removeCookie(SESSION_COOKIE_NAME);
}
示例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);
}
示例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();
}
}
示例12: removeSession
import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
/**
*
*/
public void removeSession () {
Window.get().setSession(null);
session = null;
Cookies.removeCookie(COOKIE_KEY_ID);
}
示例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;
}
示例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);
}
示例15: onError
import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
@Override
public void onError() {
// Authoring.loginIncorrect();
Cookies.removeCookie(AUTH_COOKIE);
Cookies.removeCookie(USERNAME_COOKIE);
}