Thank you so much. I was not aware of the info from Step 3.
Since I did tryout many of the combinations for the cookie format, I think I can now conclude that the Yahoo server only accepts the old netscape style cookie (RFC2965 didn't work) format which means:
- no version indication (version="1" didn't work)
- do not quote the values (path="/" didn't work)
- use an exact spelling of the Http header "Set-Cookie" (Set-cookie didn't work).
ps: I am not using PHP so I had to figure this out for the framework I use instead.
Any custom cookies you create will be passed to Yahoo's servers. On each subsequent page view, Yahoo's servers will send the currently set cookies in each request to your server. What this means is that you can detect the cookie on the server side, but the cookie is never passed directly to the device itself. This is why you can't see your cookies using a desktop browser's inspector.
There's a good reason for this: mobile devices have limits to the number of cookies being set, and some devices don't support cookies at all.
Here's the rough process of how this is handled by our servers:
1. Device requests a page from yourwidget.bpapps.com
2. Blueprint server fetches the requested page (outputting Blueprint XML) from your server, passing all the current cookies to your server.
3. Blueprint server delivers a custom rendering of the page directly to the device. Cookies set by your server are NOT delivered to the device itself.
And a breakdown of how you would go about setting/getting cookies on the scripts running on your server (using PHP):
1. index.php
// set a cookie
header('Set-Cookie: myKey=myValue'); // method 1
setcookie("myKey", "myValue"); // method 2
2. secondpage.php
// get the cookie
$cookie = $_COOKIE['myKey'];
Hope this helps!