Thank you for visiting the BlackBerry Support Community Forums.
BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)
BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.
"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."
- Kevin Michaluk, Founder, CrackBerry.com
Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.
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