Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Cookies management(Deleting cookies from browser)
Cookies management [message #1819459] Wed, 15 January 2020 18:46
Jorge Juan Arcila Santiago is currently offline Jorge Juan Arcila SantiagoFriend
Messages: 1
Registered: January 2020
Location: Ohio
Junior Member
Hello
I need to clean the cookies and cache from browser once the user closes the window. I'm trying code like this

//objects is a parameter, the method is called via browser.execute like this
// browser.execute("cookieCallback(document.cookie);");
Arrays.asList(objects[0].toString().split(";")).stream().forEach(cookieObj -> {
String cookie = cookieObj + "";
cookie = cookie.substring(0, cookie.indexOf("=") + 1);
if (cookie.length() > 0)
{
  cookieList.add(cookie.replace("=", "").replace(" ", ""));
}
});

cookieList.stream().forEach(cookieName -> {
  Browser.setCookie(cookieName + "=; " + expires, browser.getUrl());
});
Browser.clearSessions();

The behavior is:
I log into any website (e.g. hotmail) and I click on the remember me checkbox, close the window (the above code is executed), but when I reopen the browser the session is still open.
Does any one know how I an avoid that behavior?


Jorge Arcila
Previous Topic:Illegal reflective access operation
Next Topic:Drag and Drop from SWT to embbedded AWT frame (SWT_AWT) is broken on Linux GTK 3.22
Goto Forum:
  


Current Time: Wed Apr 14 15:05:44 GMT 2021

Powered by FUDForum. Page generated in 0.01190 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top