J Aaron Farr
2008-Apr-08 12:06 UTC
[Facebooker-talk] Session Expired for Profile Publishing
Ok. I''m not having any success with publishing profile FBML. Example code: class WelcomeController < ApplicationController layout "facebook" ensure_application_is_installed_by_facebook_user def index @user = facebook_session.user ... @user.profile_fbml = render_to_string( :template => ''welcome/profile'' ) end end Results in this error: Facebooker::Session::SessionExpired (Session key invalid or no longer valid): /vendor/plugins/facebooker/lib/facebooker/parser.rb:386:in `process'' /vendor/plugins/facebooker/lib/facebooker/parser.rb:15:in `parse'' /vendor/plugins/facebooker/lib/facebooker/service.rb:13:in `post'' /vendor/plugins/facebooker/lib/facebooker/session.rb:399:in `post'' /vendor/plugins/facebooker/lib/facebooker/models/user.rb:158:in `set_profile_fbml'' Using a publisher isn''t helping. Publisher code: def profile_update(user, session_user = user) send_as :profile from session_user recipients user profile render( :partial => ''profile'',:assigns => { :profile_user => user }) end ... MyPublisher.deliver_profile_update( @user ) Results in: Facebooker::Session::SessionExpired (Session key invalid or no longer valid): /vendor/plugins/facebooker/lib/facebooker/parser.rb:386:in `process'' /vendor/plugins/facebooker/lib/facebooker/parser.rb:15:in `parse'' /vendor/plugins/facebooker/lib/facebooker/service.rb:13:in `post'' /vendor/plugins/facebooker/lib/facebooker/session.rb:399:in `post'' /vendor/plugins/facebooker/lib/facebooker/models/user.rb:71:in `populate'' /vendor/plugins/facebooker/lib/facebooker/model.rb:35:in `uid'' /app/models/publisher.rb:14:in `profile_update'' ... The only way I can get it to work is to start a new session and use code as suggested in the comments here: <http://apps.facebook.com/facebooker_tutorial/messaging/mini_feed> like this: MyPublisher.deliver_profile_update(@user.create_session.user) That seems very wrong. Why do I need to (1) separately store the session_key (as in the link above) and (2) create a new session in order to update the profile FBML? Any thoughts? -- jaaron
Mike Mangino
2008-Apr-08 15:38 UTC
[Facebooker-talk] Session Expired for Profile Publishing
The session expired messages normally mean that the user whose session you are using has uninstalled the application. Are you sure the session is valid? Try calling session.user.name to make sure you can make API calls with that session. Mike On Apr 8, 2008, at 7:06 AM, J Aaron Farr wrote:> Ok. I''m not having any success with publishing profile FBML. > > Example code: > > class WelcomeController < ApplicationController > > layout "facebook" > ensure_application_is_installed_by_facebook_user > > def index > > @user = facebook_session.user > ... > @user.profile_fbml = render_to_string( :template => ''welcome/ > profile'' ) > > end > > end > > > Results in this error: > > Facebooker::Session::SessionExpired (Session key invalid or no > longer valid): > /vendor/plugins/facebooker/lib/facebooker/parser.rb:386:in > `process'' > /vendor/plugins/facebooker/lib/facebooker/parser.rb:15:in `parse'' > /vendor/plugins/facebooker/lib/facebooker/service.rb:13:in `post'' > /vendor/plugins/facebooker/lib/facebooker/session.rb:399:in `post'' > /vendor/plugins/facebooker/lib/facebooker/models/user.rb:158:in > `set_profile_fbml'' > > > Using a publisher isn''t helping. Publisher code: > > def profile_update(user, session_user = user) > send_as :profile > from session_user > recipients user > profile render( :partial => ''profile'',:assigns => { :profile_user > => user }) > end > > ... > > MyPublisher.deliver_profile_update( @user ) > > Results in: > > Facebooker::Session::SessionExpired (Session key invalid or no > longer valid): > /vendor/plugins/facebooker/lib/facebooker/parser.rb:386:in > `process'' > /vendor/plugins/facebooker/lib/facebooker/parser.rb:15:in `parse'' > /vendor/plugins/facebooker/lib/facebooker/service.rb:13:in `post'' > /vendor/plugins/facebooker/lib/facebooker/session.rb:399:in `post'' > /vendor/plugins/facebooker/lib/facebooker/models/user.rb:71:in > `populate'' > /vendor/plugins/facebooker/lib/facebooker/model.rb:35:in `uid'' > /app/models/publisher.rb:14:in `profile_update'' > ... > > The only way I can get it to work is to start a new session and use > code as suggested in the comments here: > <http://apps.facebook.com/facebooker_tutorial/messaging/mini_feed> > > like this: > > MyPublisher.deliver_profile_update(@user.create_session.user) > > > That seems very wrong. Why do I need to (1) separately store the > session_key (as in the link above) and (2) create a new session in > order to update the profile FBML? > > Any thoughts? > > -- jaaron > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk-- Mike Mangino http://www.elevatedrails.com
J Aaron Farr
2008-Apr-08 16:02 UTC
[Facebooker-talk] Session Expired for Profile Publishing
On 4/8/08, Mike Mangino <mmangino at elevatedrails.com> wrote:> The session expired messages normally mean that the user whose session > you are using has uninstalled the application. Are you sure the > session is valid? > > Try calling session.user.name to make sure you can make API calls with > that session.The user is me! I know I''ve got the application installed. At the moment, I''ve resorted to creating new sessions before trying to publish the profile FBML. That works, but it seems excessive. -- jaaron
Jaime Bulmer
2008-Apr-08 17:32 UTC
[Facebooker-talk] Session Expired for Profile Publishing
Are you using Active Record Stored sessions or the default cookie based ones? I get all sorts of different session errors with cookies based sessions, none when using Active record storage. On 8-Apr-08, at 1:02 PM, J Aaron Farr wrote:> On 4/8/08, Mike Mangino <mmangino at elevatedrails.com> wrote: >> The session expired messages normally mean that the user whose >> session >> you are using has uninstalled the application. Are you sure the >> session is valid? >> >> Try calling session.user.name to make sure you can make API calls >> with >> that session. > > The user is me! > > I know I''ve got the application installed. > > At the moment, I''ve resorted to creating new sessions before trying to > publish the profile FBML. That works, but it seems excessive. > > -- > jaaron > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talkBest Regards, Jaime Bulmer Rails Consultant Spheric Technologies Inc jbulmer at spheric.ca "An invasion of armies can be resisted, but not an idea whose time has come." ~ Victor Hugo Notice: This email message, together with any attachments, may contain information of Spheric Technologies Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080408/be56251f/attachment.html
Maybe Matching Threads
- Profile updates using profile_main
- trouble with MyPublisher.deliver_story
- Problems with *_path() and *_url() helpers when using Publisher
- Facebooker::Session::SessionExpired (Session key invalid or no longer valid)
- Error when posting facebook.feed.publishActionOfUser