how can make login and keep user inline when login on mobile android
i make code with php
define('CSRF_PROTECTION', false);
require_once($vbpath.'includes/vb5/autoloader.php');
vB5_Autoloader::register($vbpath);
vB5_Frontend_Application::init('config.php');
$api = Api_InterfaceAbstract::instance();
$password = array(
'password' => $_GET['password'],
'md5password' => md5($_GET['password']),
'md5password_utf' => '',
);
$extraAuthInfo = array();
$response = $api->callApi('user', 'login2', array($_GET['username'], $password ,$extraAuthInfo,''));
if (empty($response['errors'])){
vB5_Auth::setLoginCookies($response, '', true);
$responseData = array($response);
$responsee = $api->callApi('user', 'fetchProfileInfo', array($response['userid']));
$responseee = array($responsee);
$responseeee = array('success'=>'1' , 'message'=>"تم تسجيل الدخول بنجاح", 'data2'=> $responseData , 'data'=> $responseee);
echo json_encode($responseeee ,true);
}else{
$responseـ1 = array($response);
$responseData = array('success'=>'0', 'message'=>"اسم المستخدم او كلمه المرور غير صحيحة" , 'data'=> $responseـ1);
echo json_encode($responseData,true);
}
but user not onilne and show this user not logged why ?
i make code with php
define('CSRF_PROTECTION', false);
require_once($vbpath.'includes/vb5/autoloader.php');
vB5_Autoloader::register($vbpath);
vB5_Frontend_Application::init('config.php');
$api = Api_InterfaceAbstract::instance();
$password = array(
'password' => $_GET['password'],
'md5password' => md5($_GET['password']),
'md5password_utf' => '',
);
$extraAuthInfo = array();
$response = $api->callApi('user', 'login2', array($_GET['username'], $password ,$extraAuthInfo,''));
if (empty($response['errors'])){
vB5_Auth::setLoginCookies($response, '', true);
$responseData = array($response);
$responsee = $api->callApi('user', 'fetchProfileInfo', array($response['userid']));
$responseee = array($responsee);
$responseeee = array('success'=>'1' , 'message'=>"تم تسجيل الدخول بنجاح", 'data2'=> $responseData , 'data'=> $responseee);
echo json_encode($responseeee ,true);
}else{
$responseـ1 = array($response);
$responseData = array('success'=>'0', 'message'=>"اسم المستخدم او كلمه المرور غير صحيحة" , 'data'=> $responseـ1);
echo json_encode($responseData,true);
}
but user not onilne and show this user not logged why ?
Comment