FB.logout()-无访问令牌-“以其他用户身份登录" [英] FB.logout() - no access token - "Log in as Different User"

查看:107
本文介绍了FB.logout()-无访问令牌-“以其他用户身份登录"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该问题与该问题有关: FB.logout( )在没有访问令牌的情况下被调用

This question is in relation to this question: FB.logout() called without an access token

我有一个问题,希望有人能提供帮助.

I had a question i was hoping someone could help with.

上面链接中提供了所有内容,但是当有人使用公共计算机并意外使自己登录FB时,您该如何处理?然后,新用户尝试登录到应用程序,但不是他们.我希望有一个按钮可以将他们完全退出FB,以以其他用户身份登录".

I get everything in the link above, but how do you handle when someone uses a public computer and leaves themselves logged in to FB by accident? Then a new user tries to log in to an app, but it is not them. I want to have a button to log them out of FB altogether to "log in as a different user".

在他们授权该应用之前,我无法这样做,对吗?因此,他们需要使用他人的帐户授权该应用程序,然后注销?必须有另一种方式.

I cannot do that until they authorize the app, right? So they need to authorize the app under someone else's account and then log out? There has to be another way.

任何反馈都是很好的-尝试为此搜索了一段时间,但无济于事.我可能会考虑过度,但是应该有某种方式以其他用户身份登录".

Any feedback would be great - tried searching for a while on this, but to no avail. I might be over thinking it, but there should be some way to "log in as a different user".

推荐答案

尝试使用会话并在该会话中保存用户的ID. 您可以控制该会话的过期时间(如果用户在页面上没有任何活动,则默认为20分钟) 然后在每个页面中加载甚至检查该用户的季节是否仍然有效.

Try to use Session and save the user's ID in that session. You can control the expiration time of that session( by default its 20 minute if the user doesn't have any activity on the page) then in each page Load even check whether the season is still active for that user or not.

页面加载事件:

if(Session["LoggedIn"]==null)
{
Response.Redirect("~/Login.aspx");
}

如果会话已过期,则上面的这段代码会将用户重定向到您网站的登录页面.

This code above will redirect user to login page of your website if the session has expired.

这篇关于FB.logout()-无访问令牌-“以其他用户身份登录"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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