Jack Sasportas wrote: > I get the following error when using a previously working cookie > function: expects parameter 3 to be long > > Code is below... I just don't see the difference then the way the doc > uses: time() - 3600 > > -vs- the way I did it below... > > Thanks ! > > function > f_put_cookie($user_name,$user_email,$account_type,$company_name) { > > global $HTTP_COOKIE_VARS; > global $s_c_url; > > $l_url = ".".$s_c_url; > $l_cookie_expireN = date('r', time() - 4000 ); > $l_cookie_expire = date('r', time() + 400 ); > $l_cookie_expire2 = date('r', time() + 400*30*12 );
time() - 3600 returns an integer. The date function returns a string. The function setcookie expects an integer (or long) as parameter 3. There's your problem, change your code to: $l_cookie_expireN = (int) date('r', time() - 4000 ); $l_cookie_expire = (int) date('r', time() + 400 ); $l_cookie_expire2 = (int) date('r', time() + 400*30*12 ); HTH Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php