Where does Drupal 7 clear my custom set cookies and how do I stop this? I have parts of my website that are not controlled by drupal that set cookies. 

When I access a drupal-run page, my cookies get cleared. I tried to investigate which script does this by placing print_r($_COOKIE) all over the place in html.tpl.php, but no luck.

Anybody know whats happening here and how I could set my own custom cookies with PHP in drupal template files? 

cheers
Please find more about setting cookies using php setcookie function.

As explained in above link, please look into third and fourth params in above function

Path

The path on the server in which the cookie will be available on. If set to '/', the cookie will be available within the entire domain. If set to '/foo/', the cookie will only be available within the /foo/ directory and all sub-directories such as /foo/bar/ of domain. The default value is the current directory that the cookie is being set in.

Domain

The domain that the cookie is available to. Setting the domain to 'www.example.com' will make the cookie available in the www subdomain and higher subdomains. Cookies available to a lower domain, such as 'example.com' will be available to higher subdomains, such as 'www.example.com'. Older browsers still implementing the deprecated » RFC 2109 may require a leading . to match all subdomains.

Please check your code where you are setting cookies matches Drupal Site Domain name and Path where you are trying to access or print them.

You can set cookies in Drupal using user_cookie_save function.

For Example

user_cookie_save(array('key'=&gt;'value'));
print $_COOKIE['Drupal_visitor_key']; //outputs value