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


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.


Reply
Developer
Posts: 268
Registered: ‎08-19-2009
My Device: Bold 9700
Accepted Solution

Cookie support in OS5

Please tell me cookies are supported in OS 5 via javascript's document.cookie property. From my experience, they're not working... anybody have experience here? Any official word?

Highlighted
Developer
Posts: 164
Registered: ‎08-26-2010
My Device: Not Specified

Re: Cookie support in OS5

[ Edited ]

my experience in webworks is nothing problems when implementing cookies even in OS 5.

 

here are my javascript code functions i always use to implement cookies and they are working well:

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}

function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toUTCString());
}

function checkCookie(c_name)
{

var username=getCookie(c_name);

if (username != null && trim(username) != "")
  {
  return true;
  }
else
  {
 
  if (username!=null && trim(username) != "")
    {
     return false;
    }
  }

}

function eraseCookie(name) {
	setCookie(name,"",-1);
}

 

Developer
Posts: 268
Registered: ‎08-19-2009
My Device: Bold 9700

Re: Cookie support in OS5

Thanks for the response. Do your cookies persist past a reboot?

Developer
Posts: 164
Registered: ‎08-26-2010
My Device: Not Specified

Re: Cookie support in OS5

 
Developer
Posts: 164
Registered: ‎08-26-2010
My Device: Not Specified

Re: Cookie support in OS5


shnuffy wrote:

Thanks for the response. Do your cookies persist past a reboot?


sorry got error on previous post,

 

about cookies, it will be removed every time after device get reboot.

So you cannot make it persistent.