src/UCProSession.php
public function checkSessionByRPC( $objParam, & $nCheckReturn = null )
	{
		if ( ! CLib::IsObjectWithProperties( $objParam,
			[
				UCProConst::CKX_MID,
				UCProConst::CKT_SS_ID,
				UCProConst::CKT_SS_URL,
				'cookie_array'
			] ) )
		{
			return UCProError::UCPROSESSION_CHECKSESSIONBYRPC_PARAM;
		}

		//	...
		$nRet		= UCProError::UCPROSESSION_CHECKSESSIONBYRPC_FAILURE;
		$nCheckReturn	= CConst::ERROR_UNKNOWN;

		//	...
		$sMId		= $objParam->{ UCProConst::CKX_MID };
		$sSessionId	= $objParam->{ UCProConst::CKT_SS_ID };
		$sSessionUrl	= $objParam->{ UCProConst::CKT_SS_URL };
		$arrCookie	= $objParam->{ 'cookie_array' };

		if ( ! CLib::IsExistingString( $sMId, true ) )
		{
			return UCProError::UCPROSESSION_CHECKSESSIONBYRPC_PARAM_MID;
		}
		if ( ! CLib::IsExistingString( $sSessionId, true ) )
		{
			return UCProError::UCPROSESSION_CHECKSESSIONBYRPC_PARAM_SS_ID;
		}
		if ( ! CLib::IsExistingString( $sSessionUrl, true ) )
		{
			return UCProError::UCPROSESSION_CHECKSESSIONBYRPC_PARAM_SS_URL;
		}
		if ( false === filter_var( $sSessionUrl, FILTER_VALIDATE_URL ) )
		{
			return UCProError::UCPROSESSION_CHECKSESSIONBYRPC_PARAM_SS_URL2;
		}

		//	...
		$nTimeout	= 5;
		$cRequest	= CRequest::GetInstance();
		$arrResponse	= [];
		$nCall		= $cRequest->Get
		(
			[
				'url'		=> $sSessionUrl,
				'data'		=> [
					UCProConst::CKX_MID	=> $sMId,
					UCProConst::CKT_SS_ID	=> $sSessionId,
				],
				'version'	=> '1.0',		//	required version of service
				'timeout'	=> $nTimeout,		//	timeout in seconds
				'cookie'	=> $arrCookie,
			],
			$arrResponse
		);
		if ( CConst::ERROR_SUCCESS == $nCall )
		{
			if ( CVData::GetInstance()->IsValidVData( $arrResponse ) )
			{
				//	...
				$nRet		= UCProError::SUCCESS;
				$nCheckReturn	= $arrResponse[ 'errorid' ];
			}
			else
			{
				$nRet	= UCProError::UCPROSESSION_CHECKSESSIONBYRPC_INVALID_VDATA;
			}
		}
		else
		{
			$nRet	= $nCall;
		}

		//	...
		return $nRet;
	}
public function checkSessionByRPC( $objParam, & $nCheckReturn = null )
	{
		if ( ! CLib::IsObjectWithProperties( $objParam,
			[
				UCProConst::CKX_MID,
				UCProConst::CKT_SS_ID,
				UCProConst::CKT_SS_URL,
				'cookie_array'
			] ) )
		{
			return UCProError::UCPROSESSION_CHECKSESSIONBYRPC_PARAM;
		}

		//	...
		$nRet		= UCProError::UCPROSESSION_CHECKSESSIONBYRPC_FAILURE;
		$nCheckReturn	= CConst::ERROR_UNKNOWN;

		//	...
		$sMId		= $objParam->{ UCProConst::CKX_MID };
		$sSessionId	= $objParam->{ UCProConst::CKT_SS_ID };
		$sSessionUrl	= $objParam->{ UCProConst::CKT_SS_URL };
		$arrCookie	= $objParam->{ 'cookie_array' };

		if ( ! CLib::IsExistingString( $sMId, true ) )
		{
			return UCProError::UCPROSESSION_CHECKSESSIONBYRPC_PARAM_MID;
		}
		if ( ! CLib::IsExistingString( $sSessionId, true ) )
		{
			return UCProError::UCPROSESSION_CHECKSESSIONBYRPC_PARAM_SS_ID;
		}
		if ( ! CLib::IsExistingString( $sSessionUrl, true ) )
		{
			return UCProError::UCPROSESSION_CHECKSESSIONBYRPC_PARAM_SS_URL;
		}
		if ( false === filter_var( $sSessionUrl, FILTER_VALIDATE_URL ) )
		{
			return UCProError::UCPROSESSION_CHECKSESSIONBYRPC_PARAM_SS_URL2;
		}

		//	...
		$nTimeout	= 5;
		$cRequest	= CRequest::GetInstance();
		$arrResponse	= [];
		$nCall		= $cRequest->Get
		(
			[
				'url'		=> $sSessionUrl,
				'data'		=> [
					UCProConst::CKX_MID	=> $sMId,
					UCProConst::CKT_SS_ID	=> $sSessionId,
				],
				'version'	=> '1.0',		//	required version of service
				'timeout'	=> $nTimeout,		//	timeout in seconds
				'cookie'	=> $arrCookie,
			],
			$arrResponse
		);
		if ( CConst::ERROR_SUCCESS == $nCall )
		{
			if ( CVData::GetInstance()->IsValidVData( $arrResponse ) )
			{
				//	...
				$nRet		= UCProError::SUCCESS;
				$nCheckReturn	= $arrResponse[ 'errorid' ];
			}
			else
			{
				$nRet	= UCProError::UCPROSESSION_CHECKSESSIONBYRPC_INVALID_VDATA;
			}
		}
		else
		{
			$nRet	= $nCall;
		}

		//	...
		return $nRet;
	}
public function checkSessionByRPC ( $ objParam , & $ nCheckReturn = null ) { if ( ! CLib :: IsObjectWithProperties ( $ objParam , [ UCProConst :: CKX_MID , UCProConst :: CKT_SS_ID , UCProConst :: CKT_SS_URL , 'cookie_array' ] ) ) { return UCProError :: UCPROSESSION_CHECKSESSIONBYRPC_PARAM ; } //	... $ nRet = UCProError :: UCPROSESSION_CHECKSESSIONBYRPC_FAILURE ; $ nCheckReturn = CConst :: ERROR_UNKNOWN ; //	... $ sMId = $ objParam -> { UCProConst :: CKX_MID } ; $ sSessionId = $ objParam -> { UCProConst :: CKT_SS_ID } ; $ sSessionUrl = $ objParam -> { UCProConst :: CKT_SS_URL } ; $ arrCookie = $ objParam -> { 'cookie_array' } ; if ( ! CLib :: IsExistingString ( $ sMId , true ) ) { return UCProError :: UCPROSESSION_CHECKSESSIONBYRPC_PARAM_MID ; } if ( ! CLib :: IsExistingString ( $ sSessionId , true ) ) { return UCProError :: UCPROSESSION_CHECKSESSIONBYRPC_PARAM_SS_ID ; } if ( ! CLib :: IsExistingString ( $ sSessionUrl , true ) ) { return UCProError :: UCPROSESSION_CHECKSESSIONBYRPC_PARAM_SS_URL ; } if ( false === filter_var ( $ sSessionUrl , FILTER_VALIDATE_URL ) ) { return UCProError :: UCPROSESSION_CHECKSESSIONBYRPC_PARAM_SS_URL2 ; } //	... $ nTimeout = 5 ; $ cRequest = CRequest :: GetInstance ( ) ; $ arrResponse = [ ] ; $ nCall = $ cRequest -> Get ( [ 'url' => $ sSessionUrl , 'data' => [ UCProConst :: CKX_MID => $ sMId , UCProConst :: CKT_SS_ID => $ sSessionId , ] , 'version' => '1.0' , //	required version of service 'timeout' => $ nTimeout , //	timeout in seconds 'cookie' => $ arrCookie , ] , $ arrResponse ) ; if ( CConst :: ERROR_SUCCESS == $ nCall ) { if ( CVData :: GetInstance ( ) -> IsValidVData ( $ arrResponse ) ) { //	... $ nRet = UCProError :: SUCCESS ; $ nCheckReturn = $ arrResponse [ 'errorid' ] ; } else { $ nRet = UCProError :: UCPROSESSION_CHECKSESSIONBYRPC_INVALID_VDATA ; } } else { $ nRet = $ nCall ; } //	... return $ nRet ; }
check session from remote server
@param	object	$objParam
@param	int	$nCheckReturn
@return	bool
check session from remote server