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

Changeset 2229

Show
Ignore:
Timestamp:
09/13/05 07:48:12 (3 years ago)
Author:
david
Message:

Moved session options to SessionManagement

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/lib/action_controller/base.rb

    r2228 r2229  
    347347        include ActionController::UploadProgress 
    348348      end 
    349  
    350       # Set the session store to be used for keeping the session data between requests. The default is using the 
    351       # file system, but you can also specify one of the other included stores (:active_record_store, :drb_store,  
    352       # :mem_cache_store, or :memory_store) or use your own class. 
    353       def session_store=(store) 
    354         ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:database_manager] = 
    355           store.is_a?(Symbol) ? CGI::Session.const_get(store.to_s.camelize) : store 
    356       end 
    357  
    358       # Returns the session store class currently used. 
    359       def session_store 
    360         ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:database_manager] 
    361       end 
    362  
    363       # Returns the hash used to configure the session. Example use: 
    364       # 
    365       #   ActionController::Base.session_options[:session_secure] = true # session only available over HTTPS 
    366       def session_options 
    367         ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS 
    368       end 
    369349    end 
    370350 
  • trunk/actionpack/lib/action_controller/session_management.rb

    r2031 r2229  
    1111 
    1212    module ClassMethods 
     13      # Set the session store to be used for keeping the session data between requests. The default is using the 
     14      # file system, but you can also specify one of the other included stores (:active_record_store, :drb_store,  
     15      # :mem_cache_store, or :memory_store) or use your own class. 
     16      def session_store=(store) 
     17        ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:database_manager] = 
     18          store.is_a?(Symbol) ? CGI::Session.const_get(store.to_s.camelize) : store 
     19      end 
     20 
     21      # Returns the session store class currently used. 
     22      def session_store 
     23        ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:database_manager] 
     24      end 
     25 
     26      # Returns the hash used to configure the session. Example use: 
     27      # 
     28      #   ActionController::Base.session_options[:session_secure] = true # session only available over HTTPS 
     29      def session_options 
     30        ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS 
     31      end 
     32       
    1333      # Specify how sessions ought to be managed for a subset of the actions on 
    1434      # the controller. Like filters, you can specify <tt>:only</tt> and