I'm trying to query a mongodb database with the _id stored in a session variable...
getting the _id and store as session variable:
$_SESSION['user']['userid']=$user['_id']->{'$id'};
querying db - error on this line:
$user=collection->findOne(array('_id' => new MongoId($_SESSION['user']['userid'])));
can't figure it out.