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
New Developer
chubbard
Posts: 6
Registered: ‎08-03-2009
My Device: Not Specified

Cookie issue with Blackberry Browser.

[ Edited ]

Hello there!  I seem to have discovered an issue with the Blackberry browser and cookies.  In the example below, the cookie data does not appear until you hit Refresh from the Blackberry menu.

 

<?php
$Do = $HTTP_POST_VARS['Do'];
if ($Do == "Test") {
  $string = $HTTP_POST_VARS['string'];
  setcookie('string', $string);
  header("Location: test.php");
}
else {
  if (isset($string)) {
    setcookie('string', '', time() - 3600);
    print "
      Your Cookie is: $string
      <br><a href=test.php>Do again</a>
    ";
  }
  else {
    print "
    Input a value for the cookie test:
    <form action=test.php method=post>
      <input type=text name=string size=20>
      <input type=submit name=Do value=Test>
    </form>
    ";
  }
}
?>

 

To reproduce this, simply create a file called test.php on your web server and then test it with the phone.  This works fine on every browser that I can think of for PC and Mac and also seems to work fine on the G1, however, I have tested this with both the Blackberry Storm and the Blackberry Bold and both of these models have the same problem.  The cookie data simply does not show up until I hit 'refresh'.  Likewise, you will notice in the example above that the cookie is destroyed as soon as the data is displayed.  Again, the cookie also does not seem to disappear until after I hit 'refresh'.  At first I thought the issue was due to the page getting re-directed back to itself, however, I also tried redirecting this data to another page called test2.php and the same issue occurred.  If I am doing something wrong, please let me know, otherwise this appears to be a bug in the Blackberry browser since this seems to work fine everywhere else.

Message Edited by chubbard on 08-03-2009 01:45 AM
Message Edited by chubbard on 08-03-2009 01:48 AM
Please use plain text.
New Developer
chubbard
Posts: 6
Registered: ‎08-03-2009
My Device: Not Specified

Re: Cookie issue with Blackberry Browser.

Is there any reason no one has responded to this?  Did I post in the wrong spot?  Is this issue already known and in process of being fixed? Do I need to add more information?  Please let me know.
Please use plain text.
New Developer
kknuth
Posts: 19
Registered: ‎10-08-2008
My Device: Not Specified

Re: Cookie issue with Blackberry Browser.

You might try submitting it to their JIRA issue tracker. 

http://na.blackberry.com/eng/developers/resources/issuetracker/

Please use plain text.
New Developer
chubbard
Posts: 6
Registered: ‎08-03-2009
My Device: Not Specified

Re: Cookie issue with Blackberry Browser.

Thanks for the advice.  I posted the bug.

 

https://www.blackberry.com/jira/browse/WEBAPI-15

Please use plain text.