I am also trying to do a similar check. (ie: If an admin is logged into wordpress, I would like for the admin to be able to access a standalone php file in the plugins folder).
For the code below to work (to get the COOKIEHASH), what should I include from wp?
$user_login = $_COOKIE[‘wordpressuser_’ . COOKIEHASH];
if($user_login) {