php - Check if user is logged in multiple choice -
i want check if user logged in. have 2 login system. first facebook login system , second own created login system. want ask if user login facebook system or own login system. have tried code this. before or operator facebook login , after or own login system. both works separately not in same system. facebook login system works own login system not works if use if (!isset($_session['valid']) && $_session['valid'] ==false)
if (!isset($_session['valid']) && $_session['valid'] ==false) || (!$user->is_logged_in()) { echo "please, log in!"; header('location:login_page.php'); }
you can add 2 session in each login system. can check login system
for example if user logined facebook
add session , set it
$_session["loginedby"]="facebook";
your login system
$_session["loginedby"]="default";
and can check if user loginned facebook redirect page
if($_session["loginedby"]=="facebook";) echo 'you logined facebook !'; elseif($_session["loginedby"]=="default";) echo 'you logined default login system !';
Comments
Post a Comment