I'm getting a bit confused about how cookies work in different timezones and wondered if someone could shed some light? I'm using a now() function like CodeIgniter's that works out the current timestamp in GMT:
Code: Select all
$now = time();
$time = mktime(gmdate('H', $now), gmdate('i', $now), gmdate('s', $now), gmdate('m', $now), gmdate('d', $now), gmdate('Y', $now));Code: Select all
$now = now(); // 2011-09-11 18:00:00 UTC
$expire = $now + 3600; // 2011-09-11 19:00:00 UTC
setcookie('cookie_name', 'cookie_value', $expire);Thanks in advance.
P.S. Apologies if this is the wrong place for the question! I'm not sure if this counts as theory / design ..