Quote:
Originally Posted by cslave Why isn't this working? What's wrong?
And how are you trying to save and recover the cookies? PHP? It should work...since cookies work easily for every other website I visit on my BB I would say theres a tiny problem with your website coding (IIRC). |
cslave,
I can get cookies to work fine with Opera Mini but for some reason I can't set them using the Blackberry browser. I can't count on users having Opera. I set the cookie (same code on server for both browsers) yet when I go into cache on BB browser, it says 0 cookies. Obviously at that point I can't read them either. Go into Opera, go to same page and cookies get set, and cookies are read back without a problem.
Any suggestions?
This is my code. Can't get any simpler...
set Cookie
<?php
$value = 'Test';
setcookie("TestCookie", $value, time()+240);
?>
ReadCookie
<?php
// Print an individual cookie
echo $_COOKIE["TestCookie"];
// Another way to debug/test is to view all cookies
print_r($_COOKIE);
?>
Works with multiple cookies in Opera. Expiration set for 4 minutes but tested immediately. Tested in Blackberry, Firefox, & Internet Explorer mode.
Thanks