You could try a couple ways of doing this, require the code directly. If you do a require for sapphire/main.php that should load in quite a few classes on your behalf but this could fail as it expects to be passed a direct web request. Otherwise you could make your custom code check for the session values SS sets. I assume your PHP is running on the same PHPSESSION so you should be able to use $_SESSION directly in your code to see if the user is logged in.
You could create a basic API for sending information to your application i.e a custom controller which returns the user information in JSON. You could then load the controller via CURL.
<?php
class Public extends Controller {
function member() {
return json_encode(Member::currentUser());
}
}
Hitting yoursite.com/Public/member with a curl request will then return the JSON object for the currently logged in member. Of course this will only work if you share the same session ID as the app itself.