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

Web and WebWorks Development

New Developer
Posts: 4
Registered: ‎11-18-2008
My Device: Not Specified

javascript document.cookie problem

Hi all,

I'm trying to use the BrowserField2 and cookies, in a web page using:


<body><SCRIPT language="javascript">

 alert("set cookie!");
 document.cookie = "testCookie=s; expires=Thu, 01-Jan-12 00:00:01 GMT";




the 2nd alert is never shown.

I've tried also with try/catch but the javascript execution is always blocked in the line

document.cookie = ...

but the html is rendered correctly

In the app i'm using the config:

_bfConfig.setProperty(BrowserFieldConfig.ALLOW_CS_XHR, Boolean.TRUE);
 _bfConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE, BrowserFieldConfig.NAVIGATION_MODE_POINTER);
 _bfConfig.setProperty(BrowserFieldConfig.JAVASCRIPT_ENABLED, Boolean.TRUE);
 _bfConfig.setProperty(BrowserFieldConfig.ENABLE_COOKIES, Boolean.TRUE);
 _bfConfig.setProperty(BrowserFieldConfig.COOKIE_MANAGER, _cookieManager);

 _bfConfig.setProperty(BrowserFieldConfig.CONTROLLER, _protocolController);


tested in

simulator BB 8900 OS

device BB8900 OS


Is it possible to use document.cookie = ... ?