October 2008
Beginner to intermediate
224 pages
5h 34m
English
A lot of things can be configured in the config/environment.rb file. This list is not exhaustive.
config.action_controller.session_store = :active_record_store
# one of :active_record_store, :drb_store,
# :mem_cache_store, or :memory_store or your own class
ActionController::Base.session_options[:session_key] = 'my_app'
# use an application specific session_key
ActionController::Base.session_options[:session_id] = '12345'
# use this session_id. Will be created if not specified
ActionController::Base.session_options[:session_expires] = 3.minute.from_now
# how long before a session expires?
ActionController::Base.session_options[:new_session] = true
# force the creation of a new session
ActionController::Base.session_options[:session_secure] = true
# only use sessions over HTTPS
ActionController::Base.session_options[:session_domain] = 'invisible.ch'
# Specify which domain this session is valid for (default: hostname of server)
ActionController::Base.session_options[:session_path] = '/my_app'
# the path for which this session applies. Defaults to the
# directory of the CGI scriptLearn more: http://api.rubyonrails.com/classes/ActionController/SessionManagement/ClassMethods.html
ActionController::Base.fragment_cache_store = :file_store, "/path/to/cache/directory"
Learn more: http://api.rubyonrails.com/classes/ActionController/Caching.html
Read now
Unlock full access