Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8177

Show
Ignore:
Timestamp:
11/21/07 05:00:25 (2 years ago)
Author:
nzkoz
Message:

Merge [8176] to stable to fix session fixation attacks. Closes #10048 [theflow, Koz]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1-2-stable/actionpack/lib/action_controller/cgi_process.rb

    r7720 r8177  
    3737 
    3838  class CgiRequest < AbstractRequest #:nodoc: 
    39     attr_accessor :cgi, :session_options, :cookie_only 
     39    attr_accessor :cgi, :session_options 
    4040    class SessionFixationAttempt < StandardError; end #:nodoc: 
    4141 
     
    4444      :prefix           => "ruby_sess.", 
    4545      :session_path     => "/", 
     46      :session_key      => "_session_id", 
    4647      :cookie_only      => true 
    4748    } unless const_defined?(:DEFAULT_SESSION_OPTIONS) 
     
    5152      @session_options = session_options 
    5253      @env = @cgi.send(:env_table) 
    53       @cookie_only = session_options.delete :cookie_only 
    5454      super() 
     55    end 
     56 
     57    def cookie_only? 
     58      session_options_with_string_keys['cookie_only'] 
    5559    end 
    5660 
     
    115119        else 
    116120          stale_session_check! do 
    117             if @cookie_only && request_parameters[session_options_with_string_keys['session_key']] 
     121            if cookie_only? && request_parameters[session_options_with_string_keys['session_key']] 
    118122              raise SessionFixationAttempt 
    119123            end