[Facebooker-talk] Session Best Practices

William Thomas
2008-06-12T20:39:26Z

Hi All- I am still trying to figure out the best way to handle facebook session
for my users. Here is my current flow:

in my "external accounts controller"

1) before_filter :ensure_authenticated_to_facebook, :only =&gt;
[:authenticate_facebook, :edit_facebook]

2) when the user links into facebook, facebooker authenticates and redirects
back to my application

3) i detect the "auth_token" param in my method and store the
session_key

4) now the session[:facebook_session] is good to go

....

when a user logs in i detect if they have ever authorized facebook, if they have
a reconstitute a facebooker session :
session[:facebook_session] ||=&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; returning
Facebooker::Session.create do |session|&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
session.secure_with!(facebook.sessions_key, facebook.fb_user_id,
1.day.from_now)&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
end&nbsp;

So... this all looks great. The problem is that when I add

before_filter :ensure_has_status_update , :only =&gt;
[:authenticate_facebook, :edit_facebook]
it always asks permission to do this - even when I confirm on facebook , this
before_filter thinks I don''t have permission...

thoughts?





-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/facebooker-talk/attachments/20080612/d38a26e3/attachment.html>