Try this
$returnUrl = "http://". $_SERVER['HTTP_HOST'] ."/plan/detail";
//$returnUrlNew = "http://". $_SERVER['HTTP_HOST'] ."/plan/detail";
$isActive = YahooSession::hasSession(YAHOO_CUNSUMER_KEY, YAHOO_SECRET_KEY, YAHOO_APPID);
$authorization_url = YahooSession::createAuthorizationUrl(YAHOO_CUNSUMER_KEY, YAHOO_SECRET_KEY, $returnUrl);
$this->set('authorization_url', $authorization_url);
$authorization_url_new = YahooSession::createAuthorizationUrl(YAHOO_CUNSUMER_KEY, YAHOO_SECRET_KEY, $returnUrl);
$this->set('authorization_url_new', $authorization_url_new);
if($isActive){
//$session = YahooSession::requireSession(CONSUMER_KEY, CONSUMER_SECRET, APPID);
$session = YahooSession::requireSession(YAHOO_CUNSUMER_KEY, YAHOO_SECRET_KEY, YAHOO_APPID);
$user = $session->getSessionedUser();
$contacts = new stdClass();
$contacts = $user->getProfile();
}