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
Developer
Posts: 166
Registered: ‎03-04-2011
My Device: Playbook

Save key/value pairs on cookies on Blackberry OS 5 or greater

I'm going to develop a Blackberry OS 5 + application and I need to store an email, password and language settings.

 

Blackberry OS 5 doesn't have Local Storage support so I need to use another approach. Somewhere I read that I can use cookies (password will be stored encrypted).

 

But my problem is I don't know how to create, save and read a cookie using Webworks SDK and/or javascript.

 

How can I do it? 

Developer
Developer
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: Save key/value pairs on cookies on Blackberry OS 5 or greater


VansFannel wrote:

I'm going to develop a Blackberry OS 5 + application and I need to store an email, password and language settings.

 

Blackberry OS 5 doesn't have Local Storage support so I need to use another approach. Somewhere I read that I can use cookies (password will be stored encrypted).

 

But my problem is I don't know how to create, save and read a cookie using Webworks SDK and/or javascript.

 

How can I do it? 


Do you want to make the cookies available after an app restart, or what is the need for cookies on older devices not supporting sessionStorage or localStorage?


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Developer
Developer
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: Save key/value pairs on cookies on Blackberry OS 5 or greater

[ Edited ]

Tried to search the forum? This post might be interesting to start with for you: http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Cookie-support-in-OS5/m-p/144793...


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Developer
Posts: 166
Registered: ‎03-04-2011
My Device: Playbook

Re: Save key/value pairs on cookies on Blackberry OS 5 or greater

I want to store it because I don't want to ask user every time about his user name and password.

Developer
Developer
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: Save key/value pairs on cookies on Blackberry OS 5 or greater


VansFannel wrote:

I want to store it because I don't want to ask user every time about his user name and password.


Give the example in the provide link a try. If that doesn't work, what about HTML5 Database? Supported in BB 5.0+, PB and BB10!


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Developer
Posts: 192
Registered: ‎09-23-2009
My Device: 9860/PlayBook/Dev Alpha
My Carrier: Plus GSM

Re: Save key/value pairs on cookies on Blackberry OS 5 or greater

WebSQL is supported by all platforms - from 5 to 10. Cookies works also, and any cookie browser based code will work.

 

Nor WebSQL or cookies from WebWorks will not be synchronized or backed up when connected to Desktop Manager.

Found my post helpfull? Like it! It solves your trouble? Help others and accept it as solution. Search before asking.
My apps: Secret Cod3s | Should my tablet be banned?
--
Jakub Nietrzeba
PGS Software S.A.
Your reliable partner in Poland - IT Outsourcing - BlackBerry, iPhone, Web and Standalone applications