12-25-2011 08:57 AM
I'm trying to write a new program for BB using JRE 6.0 in which the user is able to sign in using Google openID.
At first I'm sending a request for my server to get the google url so it can keep the session then
I'm loading the url using BrowserField, let the user enter his details and in the end of the process I get the session ID.
the trouble occurs when another user trying to log in using the same app - the BrowserField/BB saving some cookies about the user and instead of his sign in screen, Google automaticly give me the previous user session.
// Getting Google URL strData = new AccountServerDA().getOpenIDUrl(strProvider,strEmai
l); // Trying to set a cookie BrowserFieldCookieManager cookieMan = myBrowserField.getCookieManager(); Dialog.alert("Current Cookie: " + cookieMan.getCookie(strData)); cookieMan.setCookie(strData, ""); Dialog.alert("New Cookie: " + cookieMan.getCookie(strData)); myBrowserField.setFocus(); myBrowserField.requestContent(strData);
I tried doing .refresh(), setting a new cookie using CookieManager (as you can see in the example) and also asking for requestContent with Hashtable holding an empty cookie. none of those methods helped.
As anyone got an idea how can I delete/replace those cookies and let a new user use the openid screen?
12-25-2011 01:54 PM - edited 12-25-2011 01:57 PM
You can try and initiate the browserField before the second user request:
myBrowserField = new BrowserField();
Hope that helps,
Just saw your second post...
Have you tried to reset the CookieManager?
You can do it using the BrowserFieldConfig object.
12-27-2011 06:32 AM
Thanks maadani. Can you please elaborate on how to reset the CookieManager? I only successed in implmanting a new one but which can't handle cookies so google had to reject my request...
05-09-2012 03:41 AM
I am stuck with the same issue.
i am unable to clear cookies in the browserfield's cookieManager. Creating a new instance of BrowserField did not help, because if i do newInstanceBF.getcookieManager() will still give me all the existing cookies.
How can i flush all the cookies ? Please suggest