[Facebooker-talk] Session Expired for Profile Publishing

Mike Mangino mmangino at elevatedrails.com
Tue Apr 8 11:38:57 EDT 2008


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





More information about the Facebooker-talk mailing list