On the website, there will be two ways of login - facebook login or website standard login.
What is the correct way to determine if user logged with facebook or website login?
I am thinking adding a field called login_type
field in users
table.
value will be "facebook" or "standard"
If user logged in via facebook then store the value of login_type
in the session something like $_SESSION['login_type'] = "facebook"
;
However, if user want to logout, we need to make sure to execute facebook logout function.
Something like this?
logout.php
if ($_SESSION['login_type'] == "facebook") {
$facebook->getLogoutUrl()
//execute the url to CURL?
header("LOCATION: index.php");
}
PS: To be clear about 4.: If your app runs outside of Facebook you have to log the user out of Facebook when he logs out of your app/website. See I.6. at https://developers.facebook.com/policy/#policies .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.