Sha256: eab4fa0ddef325a834b6e9a719366d2b48306218ff0c7a2947093f0556a32fb3

Contents?: true

Size: 1.91 KB

Versions: 85

Compression:

Stored size: 1.91 KB

Contents

module ActionController
  class CgiRequest
    alias :initialize_aliased_by_facebooker :initialize

    def initialize(cgi, session_options = {})
      initialize_aliased_by_facebooker(cgi, session_options)
      @cgi.instance_variable_set("@request_params", request_parameters.merge(query_parameters))
    end
    
    DEFAULT_SESSION_OPTIONS[:cookie_only] = false
  end 
end

module ActionController
  class RackRequest < AbstractRequest #:nodoc:
    alias :initialize_aliased_by_facebooker :initialize

    def initialize(cgi, session_options = {})
      initialize_aliased_by_facebooker(cgi, session_options)
      @cgi.instance_variable_set("@request_params", request_parameters.merge(query_parameters))
    end
  end 
end

class CGI  
  class Session
      alias :initialize_aliased_by_facebooker :initialize
      attr_reader :request, :initialization_options

      def initialize(request, option={})
        @request = request
        @initialization_options = option
        option['session_id'] ||= set_session_id
        initialize_aliased_by_facebooker(request, option)
      end
      
      def set_session_id
        if session_key_should_be_set_with_facebook_session_key? 
          request_parameters[facebook_session_key]
        else 
          request_parameters[session_key]
        end
      end

      def request_parameters
        request.instance_variable_get("@request_params")
      end

      def session_key_should_be_set_with_facebook_session_key?
        request_parameters[session_key].blank? && !request_parameters[facebook_session_key].blank?
      end

      def session_key
        initialization_options['session_key'] || '_session_id'
      end

      def facebook_session_key
        'fb_sig_session_key'
      end

      alias :create_new_id_aliased_by_facebooker :create_new_id

      def create_new_id
        @new_session = true
        @session_id || create_new_id_aliased_by_facebooker
      end
  end
end

Version data entries

85 entries across 85 versions & 21 rubygems

Version Path
fs-facebooker-1.0.37 lib/facebooker/rails/facebook_session_handling.rb
micahwedemeyer-facebooker-1.0.50 lib/facebooker/rails/facebook_session_handling.rb
micahwedemeyer-facebooker-1.0.51 lib/facebooker/rails/facebook_session_handling.rb
mmangino-facebooker-1.0.30 lib/facebooker/rails/facebook_session_handling.rb
mmangino-facebooker-1.0.31 lib/facebooker/rails/facebook_session_handling.rb
mmangino-facebooker-1.0.32 lib/facebooker/rails/facebook_session_handling.rb
mmangino-facebooker-1.0.36 lib/facebooker/rails/facebook_session_handling.rb
mmangino-facebooker-1.0.37 lib/facebooker/rails/facebook_session_handling.rb
mmangino-facebooker-1.0.38 lib/facebooker/rails/facebook_session_handling.rb
mmangino-facebooker-1.0.39 lib/facebooker/rails/facebook_session_handling.rb
mmangino-facebooker-1.0.40 lib/facebooker/rails/facebook_session_handling.rb
mmangino-facebooker-1.0.41 lib/facebooker/rails/facebook_session_handling.rb
mmangino-facebooker-1.0.42 lib/facebooker/rails/facebook_session_handling.rb
mmangino-facebooker-1.0.43 lib/facebooker/rails/facebook_session_handling.rb
mmangino-facebooker-1.0.44 lib/facebooker/rails/facebook_session_handling.rb
mmangino-facebooker-1.0.45 lib/facebooker/rails/facebook_session_handling.rb
mmangino-facebooker-1.0.46 lib/facebooker/rails/facebook_session_handling.rb
mmangino-facebooker-1.0.47 lib/facebooker/rails/facebook_session_handling.rb
mmangino-facebooker-1.0.48 lib/facebooker/rails/facebook_session_handling.rb
mmangino-facebooker-1.0.49 lib/facebooker/rails/facebook_session_handling.rb