Cookie gets deleted on restarting browser
The CodeIgniter documentation says the expires
value is added to the current time. So effectively the expires
value in your case is time() + time() + 60*60*24*14
. This may be beyond the 32 Bit integer limit and turn into a negative value. This in turn will result in a temporary cookie that's deleted upon closing the browser.
$test_cookie = array( 'name'=>'test', 'value'=> 'test', 'expire'=> 60*60*24*14);
should work. I think.