Hi, I'm building an I-Mode version of our German website and I am having some trouble with the cookies. Here is a quote from one of the docs.
The PHP setcookie function it is not compatible with the Cookie specification (RFC2109) and some Web browsers. It is also not compatible with the i-mode platform. Most PHP versions (including 4.x) generate a
Set-Cookie header with a 2 digit year in the expiration date. The i-mode platform supports only a 4 digit year
or the newer "max-age" instead of "expires".
Here is a solution function which they provide.
<?php
function imode_setcookie($name,$value,$maxage,$path="",$domain="",$secure="")
{
$s = "$name=";
if ($value) $s .= urlencode($value);
$maxage = $maxage - time();
if ($maxage < 0) $maxage = 0;
$s .= "; max-age=$maxage";
if ($path) $s .= "; path=$path";
if ($domain) $s .= "; domain=$domain";
if ($secure) $s .= "; secure=$secure";
header("Set-Cookie: $s");
}
?>
Now I know this function works because I can test it in a normal browser using the following code.
<?php
include('./header/imode_funcs.php');
if($_GET['blob']==1) {
echo $HTTP_COOKIE_VARS['test'];
} else {
$test="THIS IS A TEST";
imode_session_register('test');
header('Location: [url]http://testdev6-imode.cd-wow.com[/url]'.$_SERVER['PHP_SELF'].'?blob=1');
}
?>
However when I run this through my I-Mode emulator it does not work. I'm assuming the cookie is being set because the function was provided by the i-mode provider. All I can think is that I can not retrieve it through $_COOKIE or $HTTP_COOKIE_VARS. I was just wondering if there was a way of pulling out cookies manually rather than relying on PHP to do it?
Thanks in advance
Bubble