1

我的 Facebook Connect Rails 应用程序今天早些时候工作,但似乎已经停止正确获取 Facebook 会话。

我正在使用 Facebooker gem 来处理与 Facebook 的交互。突然之间,我的应用程序开始抛出这个异常,无论是在我登录到我的 Facebook 帐户时还是在我退出时(在实际的 Facebook 网站上):

WelcomeController#index (ActionView::TemplateError) "Session key invalid or no longer valid"

On line #4 of app/views/welcome/_friends.html.erb
1: <div class="bluebox friends_box">
2: <h3>Friends</h3>
3: <table class="friends_table">
4: <% friends = facebook_user.friends_with_this_app %>
5: <% if friends.any? %>
6: <% friends.each do |friend| %>
7: <tr class="friend_row"> 

app/views/welcome/_friends.html.erb:4
app/views/welcome/_logged_in_index.html.erb:90
app/views/welcome/index.html.erb:2
<internal:prelude>:8:in `synchronize'
<internal:prelude>:8:in `synchronize'
4

1 回答 1

0

First of all, make sure that your app is authorized with Facebook by going to the following address in the browser window where you got the exception:

http://www.facebook.com/login.php?api_key=YOUR_APP_KEY&next=RETURN_URL

If you're getting the error after that, more than likely, it has to do with Facebook itself. Sometimes it helps to get the session key out of cookie ("YOUR_APP_KEY" + "_session_key" cookie), but sometimes it doesn't work either.

于 2010-07-13T16:42:00.490 回答