10-16-2008 06:41 AM
Can we set and get blackberry browser cookies programmatically ? Also where does cookies store in blackberry device? Please provide any links or codes if any.
Thanks in advance
10-16-2008 08:13 AM
Someone from RIM will have to comment but probably these are kept secret for security issues. I have written a custom browser
and had to do cookie handling myself. You need to go to some length to avoid allowing certain kinds of cookies etc
this does work AFAIK. I'm not sure this link is right but it may help,
// 1) validate domain
// 2) sort path depth
// 3) check expiration
// 4) dup names
This link is dead but I was able to use curl cookie file to get a few things sorted out,maybe you could look up
the header terms, FWIW.
# Netscape HTTP Cookie File
# This file was generated by libcurl! Edit at your own risk.
.yahoo.com TRUE / FALSE 2127585600 B fsbmve54c55iu&b=4&d=kbcQlyhpYEIyyO9DG0d1Q4ssSyQXpc
10-16-2008 09:44 AM
It is not possible to programmatically access cookies for the BlackBerry Browser from a Java application.
10-16-2008 09:48 AM
Not that it matters, but just to be clear, how then are the cookies stored? I thought they were just in
persistent storage with a secret hash code or secured by existing API's? Is your browser implemented
largely as native code? Of course it is always possible to share the data, just not allowed.
10-16-2008 10:01 AM
Actually I m developing application in BB which connect to web service which is hotsted on windows authenticated server. So when I tries to connect to web service it asks me windows user name and password. once user id and password enters my application works fine. But this works for 30-40 mins. Once session expired again need to login to web service by entering windows user id and password.
So I was thinking that I could programatically set the windows user Id and password in cookies before launching the application to work smoothly.
Is there any way to connect to windows authenticated web service through device by passing windows user id and password programatically ?
Thanks in advance
10-16-2008 10:09 AM
10-16-2008 10:11 AM
Normally cookies are set by the server to keep track of your identity without personal information.
While it is possible a cookie could be very dumb, and the server could just accept it, I don't think that
will help you here. Normally, you send credentials over https and get back a cookie. Even if you could
fake out or reproduce the cookie, the server would still presumably determine if it was expired.
When I do this with things like curl, the strategy is usually to post credentials to a form, get back the
cookies and send those with subsequent requests.
You may be able to add an Authorization header but I've never actually tried this,