Detect If A Web User Is Currently Logged In Google?
Suppose I want to display certain content only if I know the user coming to my website has a valid Google Account and it's logged into that account. Is there any way to do this in
Solution 1:
This blog claims to have done it, via checking for image return values linked to the social platforms provided by G+ / twitter / etc
http://www.tomanthony.co.uk/blog/detect-visitor-social-networks/
<img style="display:none;"
onload="show_login_status('Google', true)"
onerror="show_login_status('Google', false)"
src="https://accounts.google.com/CheckCookie?continue=https%3A%2F%2Fwww.google.com%2Fintl%2Fen%2Fimages%2Flogos%2Faccounts_logo.png&followup=https%3A%2F%2Fwww.google.com%2Fintl%2Fen%2Fimages%2Flogos%2Faccounts_logo.png&chtml=LoginDoneHtml&checkedDomains=youtube&checkConnection=youtube%3A291%3A1"
/>
Solution 2:
<scripttype="text/javascript">functionshow_login_status(network, status){
if(status == false){
alert('NOT LOGGED IN');
}
if(status == true){
alert('Logged In');
}
}
</script><imgstyle="display:none;"onload="show_login_status('Google', true)"onerror="show_login_status('Google', false)"src="https://accounts.google.com/CheckCookie?continue=https%3A%2F%2Fwww.google.com%2Fintl%2Fen%2Fimages%2Flogos%2Faccounts_logo.png&followup=https%3A%2F%2Fwww.google.com%2Fintl%2Fen%2Fimages%2Flogos%2Faccounts_logo.png&chtml=LoginDoneHtml&checkedDomains=youtube&checkConnection=youtube%3A291%3A1"
/>
This will work.
Post a Comment for "Detect If A Web User Is Currently Logged In Google?"