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

Web and WebWorks Development

Reply
New Contributor
Posts: 9
Registered: ‎09-07-2010
My Device: Not Specified

Re: Cookie Support

Andrew, thank you.

But there are only 3 menus ("Browser Configuration", "General Properties", "Cache Operations") under the "Options". I'm using SDK installed from the update site for Eclipse. The menu "Cache Operations" contains only info. Please find the screens of two other menus below:

3.JPG2.JPG

 

Should I open a new thread regarding SDK for Eclipse?

Developer
Posts: 189
Registered: ‎08-13-2008
My Device: Not Specified

Re: Cookie Support

That all looks ok, javascript is enabled.

 

How have you tested the cookies, why do you think cookies don't work?, what happens when you try to test the cookies?

 

cheers

 

Andrew

New Contributor
Posts: 9
Registered: ‎09-07-2010
My Device: Not Specified

Re: Cookie Support

Andrew,

It worked after the restart of simulator. I used the following link to check if cookies work at all: http://www.cesarcaballeroart.com/cookietest1.htm . To my pity, they work, but not in my application.

I'm using the following functions to set and read cookies:

 

function setCookie(NameOfCookie, value, expiredays) {
    if (expiredays) {
        var ExpireDate = new Date();
        ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
        var expires = ";expires=" + ExpireDate.toGMTString();
    } else var expires = "";
    document.cookie = NameOfCookie + "=" + value + expires + ";path=/";
};

function getCookie(NameOfCookie) {
	var results = document.cookie.match ( '(^|;) ?' + NameOfCookie + '=([^;]*)(;|$)' );
	if ( results )
		return ( unescape ( results[2] ) );
	else
		return null;
};

This code works if I open the page via browser, but doesn't work in widget. Is there any option, which should enable cookies for application?

 

 

Thank you for the help.

Developer
Posts: 43
Registered: ‎02-05-2010
My Device: 8900
My Carrier: don't know

Re: Cookie Support

Hello everyone,

 

the same problem, in my widget it does nothing, but in the browser it functioned.

 

What is the problem?

 

thanx

newone

Highlighted
New Contributor
Posts: 9
Registered: ‎09-07-2010
My Device: Not Specified

Re: Cookie Support

I found the source of the problem. Cookies do not work because of the framework I'm using - PhoneGap.