function cookie_jumper($cookie_name, $redirect = '', $exp = 86400){ $mycookie = $_COOKIE[$cookie_name]!='' ? $_COOKIE[$cookie_name] : FALSE; $exp = time() + $exp; if($mycookie){ header('Location:'.get_site_url().$redirect); } else { setcookie($cookie_name,TRUE,$exp); } }