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
Contributor
amaguran
Posts: 23
Registered: ‎07-07-2010
My Device: 9700

Cannot add domain cookie

I have a WebWorks application which loads a remote page using jquery's load. I need to set a cookie for the remote url. If I specify the domain then the cookie does not get set. I have tried using:

document.cookie='key=vaue; path=/; domain=my.domain.com';

It only works with

document.cookie='key=vaue; path=/';

however, the added cookie is only available for localhost.

 

Thanks for your help.

Contributor
amaguran
Posts: 23
Registered: ‎07-07-2010
My Device: 9700

Re: Cannot add domain cookie

I have tried a different approach using

request.setRequestHeader("Cookie","key=value:smileywink:

in $.ajaxSetup -> beforeSend function.

In this case I get the following error in ripple: "Refused to set unsafe header "Cookie"".

 

Is there a way to configure WebWorks to allow this cookies?

BlackBerry Development Advisor
chadtatro
Posts: 620
Registered: ‎10-01-2009
My Device: Z10

Re: Cannot add domain cookie

Hi there,

 

I'm wondering if you're running into some browser security problems here while testing?  

 

Have you tried on a live device, or on the simulators?

Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro
Contributor
amaguran
Posts: 23
Registered: ‎07-07-2010
My Device: 9700

Re: Cannot add domain cookie

Hi,

 

I'm running in ripple. I don't have access to a DevAlpha device until next week.

 

Thanks.

BlackBerry Development Advisor
chadtatro
Posts: 620
Registered: ‎10-01-2009
My Device: Z10

Re: Cannot add domain cookie

I would try with the simulator then.  I'm leaning towards it just being a browser security issue.

Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro
Contributor
amaguran
Posts: 23
Registered: ‎07-07-2010
My Device: 9700

Re: Cannot add domain cookie

The cookie is not set on simulator 10.0.09-386.