You're using the assignment =
operator instead of the comparison ==
operator. That will always be true which is not what you want.
Change
if ($_COOKIE['visits'] = '' )
to
if ($_COOKIE['visits'] == '' )
or even better, use empty()
if (empty($_COOKIE['visits']))