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

Changeset 8189

Show
Ignore:
Timestamp:
11/22/07 05:48:45 (8 months ago)
Author:
bitsweat
Message:

Document that the cookie store is the default session store. Mention the memcached store. Closes #10241 [Josh Susser, Jeremy Kemper]

Files:

Legend:

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

    r8106 r8189  
    163163  # remove the entire session with reset_session. 
    164164  # 
    165   # By default, sessions are stored on the file system in <tt>RAILS_ROOT/tmp/sessions</tt>. Any object can be placed in the session 
    166   # (as long as it can be Marshalled). But remember that 1000 active sessions each storing a 50kb object could lead to a 50MB store on the filesystem. 
    167   # In other words, think carefully about size and caching before resorting to the use of the session on the filesystem. 
    168   # 
    169   # An alternative to storing sessions on disk is to use ActiveRecordStore to store sessions in your database, which can solve problems 
    170   # caused by storing sessions in the file system and may speed up your application. To use ActiveRecordStore, uncomment the line: 
     165  # Sessions are stored in a browser cookie that's crytographically signed, but unencrypted, by default. This prevents 
     166  # the user from tampering with the session but also allows him to see its contents. 
     167  # 
     168  # Do not put secret information in session! 
     169  # 
     170  # Other options for session storage are: 
     171  # 
     172  # ActiveRecordStore: sessions are stored in your database, which works better than PStore with multiple app servers and, 
     173  # unlike CookieStore, hides your session contents from the user. To use ActiveRecordStore, set 
    171174  # 
    172175  #   config.action_controller.session_store = :active_record_store 
    173176  # 
    174177  # in your <tt>environment.rb</tt> and run <tt>rake db:sessions:create</tt>. 
     178  # 
     179  # MemCacheStore: sessions are stored as entries in your memcached cache.  Set the session store type in <tt>environment.rb</tt>: 
     180  # 
     181  #   config.action_controller.session_store = :mem_cache_store 
     182  # 
     183  #  This assumes that memcached has been installed and configured properly.  See the MemCacheStore docs for more information. 
    175184  # 
    176185  # == Responses 
  • trunk/actionpack/lib/action_controller/session_management.rb

    r7719 r8189  
    1717 
    1818    module ClassMethods 
    19       # Set the session store to be used for keeping the session data between requests. The default is using the 
    20       # file system, but you can also specify one of the other included stores (:active_record_store, :drb_store,  
    21       # :mem_cache_store, or :memory_store) or use your own class. 
     19      # Set the session store to be used for keeping the session data between requests. By default, sessions are stored 
     20      # in browser cookies (:cookie_store), but you can also specify one of the other included stores 
     21      # (:active_record_store, :p_store, drb_store, :mem_cache_store, or :memory_store) or your own custom class. 
    2222      def session_store=(store) 
    2323        ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:database_manager] =