我如何注册用户从我的应用程序? [英] how do i sign user out of my app?

查看:160
本文介绍了我如何注册用户从我的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我implementet登入Google+ API在我的应用程序的根页。它如果用户在谷歌要在签署自动用户签名,然后自动API签署他交给我的应用程序。问题是,当用户退出我的应用程序,他被重定向到根页,其中记录了他在后面,因为他还是登录到谷歌。

I implementet Google+ Sign-In API in the root page of my app. It automatically signs in user if user is signed in to google, then API automatically signs him in to my app. The problem is that when user logs out of my app, he is redirected to root page which logs him back in, since he still is logged in to google.

您可以看到整个code在这里: https://developers.google。 COM / + / WEB /登入/

You can see the whole code here: https://developers.google.com/+/web/signin/

奇怪,他们已经又见,签约用户从您的应用程序
 链接,但它的分解:(

wierd, they have "See also, signing the user out of your app." link, but it's broken :(

任何想法?

推荐答案

这是类似于这样的问题:
  <一href=\"http://stackoverflow.com/questions/15484533/$p$pventing-automatic-sign-in-when-using-google-sign-in/15503280#15503280\">$p$pventing使用Google+登录时自动登录

This is similar to this question: Preventing automatic sign-in when using Google+ Sign-In

您可以使用,当用户是设置一个cookie的登录的在您的网站。如果用户登录,通过cookie的presence表示,允许用户自动重定向到您的网站。如果用户没有登录,需要用户点击注册按钮的隐藏按钮,将其重定向到登录的经验了。要注销用户,删除cookie。

You could use a cookie that is set when the user is logged in on your site. If the user is logged in, indicated by the presence of the cookie, allow the user to automatically get redirected into your site. If the user is not logged in, require that the user click the sign-in button before you hide the button and redirect them to the signed-in experience. To log the user out, delete the cookie.

这篇关于我如何注册用户从我的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆