removed pre PHP 5.2 code wrt setcookie and session setting

- moved cookiedir determination in the if-statement