using setcookie or set session var to reduce refreshes