Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom
Accepted Solution

How To – Enable cookies in BrowserField

Hi,

 

i was trying to incorporate this article in my Custom Browser, but it seems that i can't make it work.  I tried to just the cookies via eventOccurred section as instructed by the how-to article and display it, but it doesn't work. It doesn't enter the EVENT_SET_HTTP_COOKIE case when i tried accessing mail.yahoo.com or facebook.com.

 

Anybody tried this and made it work? 

 

I realy need to support cookies in my custom browser.

 

Thanks!

 

 

  

BlackBerry Development Advisor
Posts: 15,125
Registered: ‎07-09-2008
My Device: BlackBerry Passport
My Carrier: Bell

Re: How To – Enable cookies in BrowserField

I recommend using your own test page instead of a third party site where you can control the cookies that are set and view the cookies that are returned.

 

What BlackBerry Smartphone model and BlackBerry handheld software version are you testing on?  You can find this under Options, About on the BlackBerry Smartphone.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: How To – Enable cookies in BrowserField

I'm not sure how it is supposed to work or what is uniformly supported across OS versions but the easiest

thing to do is just read the http response headers and use "your" own cookie jar. These probably exist on the

web and aren't impossible to create from the specs. Of course, if you have canned associative containers

you can use those too.

 

Developer
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom

Re: How To – Enable cookies in BrowserField

Hi,

 

just to update this thread,  the cookie can be captured under the processConnection method of the BrowserFieldDemo application just right after invoking BrowserContent's getDisplayableContent(). 

 

I do get the cookies now. 

 

 

Thanks! 

New Developer
Posts: 4
Registered: ‎06-02-2009
My Device: Not Specified

Re: How To – Enable cookies in BrowserField

johnbibs-

 

Were you able to get cookies to work? I get the cookies through the Set Cookie Event as well as the method you just described, but am having troubles sending them back to the browser.

 

Any help would be greatly appreciated.

Developer
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom

Re: How To – Enable cookies in BrowserField

hi jasonking,

 

on what particular instance? what urls? 

 

 

Thanks 

New Developer
Posts: 4
Registered: ‎06-02-2009
My Device: Not Specified

Re: How To – Enable cookies in BrowserField

On most sites that I attempt to log in to, such as google and facebook. I've also been using various cookie testers (such as http://www.html-kit.com/tools/cookietester/), and they are not recieving the cookies back that I send them.

Developer
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom

Re: How To – Enable cookies in BrowserField

hi jasonking, 

 

I also can't login to yahoo, gmail and facebook. but i was able to access friendster.com. I don't know why yahoo rejects the cookies. with regards to gmail, it has a "Secure" attribute in the cookies, so it needs an https connection. i'm still trying to implement the https support on my browser.

 

anybody knows if there are issues in accessing yahoo mail? thanks! 

 

thanks.

 

New Developer
Posts: 4
Registered: ‎06-02-2009
My Device: Not Specified

Re: How To – Enable cookies in BrowserField

I have been able to log into some site, m.facebook.com for example. For the majority I still can not though. If anyone can provide any kind of solution that would be wonderful.
Developer
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom

Re: How To – Enable cookies in BrowserField

hi jasonking,

 

what cookie specification did you implement? netscape draft? rf2109?