Maximum value of cookie expiration time is 2147483647 (2^31 – 1 = 2147483647 = 2038-01-19 04:14:07) [see: RFC 2616, 14.6 Age]
So the example code snippet:
// substracting current time from last exp. time because CI adds current time to the value $unexpired_cookie_exp_time = 2147483647 - time(); $cookie = array( 'name' => 'cookie_name', 'value' => 'cookie_value', 'expire'=> $unexpired_cookie_exp_time ); $CI->input->set_cookie($cookie);