开发者

Cookie Manipulation in Blackberry Embedded Browser

I am using the Blackberry jre 6 to create an app.

I have a BrowserField embedded in the app that when launched always begins by going to a page that creates two cookies. Once the u开发者_如何转开发ser submits the data the page takes them to another place that returns a embedded cookie. This cookie must be stored using PersistentStore and then retrieved every time the cookie is deleted from the browser and inserted in between the two cookies mentioned earlier. The order of the cookies matters here as the initial page parses the cookies in such a way.

The problem I am having is inserting the stored cookie in between the two cookies on the initial page. I am trying to set the cookie using BrowserFieldCookieManager methods but this only inserts the missing cookie at the beginning of the cookie string. Furthermore, there appears to be no way of deleting certain cookies as that could be a workaround.

Any help is appreciated in getting the cookie in the proper place. If I am misunderstanding the concept of cookies please correct me as I am really new to any sort of web development.

Thank you.


There is no order to cookies, they can arrive in any order. So if you're requiring them to be in a specific order then yes, you will have problems.

A cookie is just a string that the web server asks the client to store for a set duration and send back whenever it requests a certain URL path. Look at the Wikipedia entry for cookie:

http://en.wikipedia.org/wiki/HTTP_cookie

in particular the "Implementation" section that shows examples of how cookies work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜