是否可以与 Facebooker 使用现有的 Facebook Connect 会话?

发布于 2024-08-17 08:08:36 字数 953 浏览 1 评论 0原文

更新:一旦我清除了 cookie,就按设计工作。哎哟!

我正在开发一个应用程序,由于各种原因使用 Facebook 用于启动 Facebook 连接会话的 Javascript API。我想成为 能够使用 Facebooker 在一些 Rails 方法中使用该会话。

基本工作流程是这样的:

  1. 用户进入非 Rails 页面,通过 JS 登录 FB Connect
  2. 用户进入另一个非 Rails 页面,可以查看 FB 数据,例如 姓名、个人资料图片
  3. 用户转到基于 Rails 的页面 - Rails 使用在以下位置创建的会话 步骤 1 进行一些处理

我的问题是在步骤 3 中。Facebooker 检测到会话正常,但是当 我尝试调用像 facebook_session.user.name 这样的方法,我得到: Session 密钥无效或不再有效

如果我返回第二步中的网址,我的会话仍然可以正常工作。

这是根本性的不兼容吗?或者我可以提供一些数据吗? 发送给 facebooker 以便我可以连接到正确的会话?或许 我的 facebooker.yml 需要调整吗?

任何想法表示赞赏。

我的 facebooker.yml

development:
 api_key: redacted
 secret_key: redacted
 canvas_page_name: blah_blah
 callback_url: http://test.domain:3000
 pretty_errors: true
 set_asset_host_to_callback_url: true
 tunnel:
   public_host_username:
   public_host:
   public_port: 4007
   local_port: 3000
   server_alive_interval: 0

Update: Working as designed once I cleared my cookies. Doh!

I'm working on an app that for various reasons uses the Facebook
Javascript API to initiate a Facebook connect session. I'd like to be
able to use that session in a few rails methods using Facebooker.

The basic workflow is like this:

  1. User goes to non-rails page and logs in to FB Connect via JS
  2. User goes to another non-rails page and can view FB data such as
    name, profile pic
  3. User goes to a rails based page - rails uses session created in
    step 1 to do some processing

My problem is in step 3. Facebooker detects the session fine, but when
I try to call a method like facebook_session.user.name I get: Session
key invalid or no longer valid

If I go back to the url in step two, my session still works fine.

So is this a fundamental incompatibility, or is there some data I can
send to facebooker so that I can hook into the correct session? Maybe
my facebooker.yml needs tweaking?

Any thoughts are appreciated.

My facebooker.yml

development:
 api_key: redacted
 secret_key: redacted
 canvas_page_name: blah_blah
 callback_url: http://test.domain:3000
 pretty_errors: true
 set_asset_host_to_callback_url: true
 tunnel:
   public_host_username:
   public_host:
   public_port: 4007
   local_port: 3000
   server_alive_interval: 0

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

似狗非友 2024-08-24 08:08:36

嘎!在互联网上发帖之前,请务必清除您的 cookie。

问题出在我的浏览器中仍然存在的基于 facebooker 的现有会话。

现在一切都在工作。

Gah! Always clear your cookies before posting on the interweb people.

The problem was with an existing facebooker-based session that was still around in my browser.

All working now.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文