I'm currently writing a site built in PHP using Parse.com to store the site's data. I've used parse in several projects before and some of the features fit extremely well. I've now run into an issue where a logged in user can't be detected properly.
<?php
use Parse\ParseClient;
use Parse\ParseObject;
use Parse\ParseQuery;
use Parse\ParseGeoPoint;
use Parse\ParseUser;
ParseClient::initialize('Omitted', 'Omitted', 'Omitted');
(... truncated)
function get_user(){
//BROKEN.
//TODO: Fix
$currentUser = ParseUser::getCurrentUser();
if ($currentUser) {
return $currentUser->getObjectId();
} else {
return false;
}
}
(... truncated)
?>
This code is only marginally modified from that in the PHP examples given by parse, but seems to return false no matter what the state of "Logged In"
Session start is called to ensure the session is running, and calling print_r($_SESSION) outputs a dump which includes the relevant user object.
I understand it's likely something silly that I've missed, but any pointers in the right direction would be much appreciated.