Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Moved session options to SessionManagement
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2229 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed Sep 13, 2005
1 parent 53ee2c9 commit 48018bf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
20 changes: 0 additions & 20 deletions actionpack/lib/action_controller/base.rb
Expand Up @@ -346,26 +346,6 @@ def enable_upload_progress # :nodoc:
require 'action_controller/upload_progress'
include ActionController::UploadProgress
end

# Set the session store to be used for keeping the session data between requests. The default is using the
# file system, but you can also specify one of the other included stores (:active_record_store, :drb_store,
# :mem_cache_store, or :memory_store) or use your own class.
def session_store=(store)
ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:database_manager] =
store.is_a?(Symbol) ? CGI::Session.const_get(store.to_s.camelize) : store
end

# Returns the session store class currently used.
def session_store
ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:database_manager]
end

# Returns the hash used to configure the session. Example use:
#
# ActionController::Base.session_options[:session_secure] = true # session only available over HTTPS
def session_options
ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS
end
end

public
Expand Down
20 changes: 20 additions & 0 deletions actionpack/lib/action_controller/session_management.rb
Expand Up @@ -10,6 +10,26 @@ def self.append_features(base)
end

module ClassMethods
# Set the session store to be used for keeping the session data between requests. The default is using the
# file system, but you can also specify one of the other included stores (:active_record_store, :drb_store,
# :mem_cache_store, or :memory_store) or use your own class.
def session_store=(store)
ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:database_manager] =
store.is_a?(Symbol) ? CGI::Session.const_get(store.to_s.camelize) : store
end

# Returns the session store class currently used.
def session_store
ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:database_manager]
end

# Returns the hash used to configure the session. Example use:
#
# ActionController::Base.session_options[:session_secure] = true # session only available over HTTPS
def session_options
ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS
end

# Specify how sessions ought to be managed for a subset of the actions on
# the controller. Like filters, you can specify <tt>:only</tt> and
# <tt>:except</tt> clauses to restrict the subset, otherwise options
Expand Down

0 comments on commit 48018bf

Please sign in to comment.