Skip to content

Commit

Permalink
Use :key instead of old :session_key in session_store.rb generator an…
Browse files Browse the repository at this point in the history
…d docs [#1746 state:resovled]

Signed-off-by: Joshua Peek <josh@joshpeek.com>
  • Loading branch information
Cody Fauser authored and josh committed Jan 13, 2009
1 parent b6a94fc commit d3107ce
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions actionpack/lib/action_controller/session/cookie_store.rb
Expand Up @@ -163,9 +163,9 @@ def unmarshal(cookie)

def ensure_session_key(key)
if key.blank?
raise ArgumentError, 'A session_key is required to write a ' +
raise ArgumentError, 'A key is required to write a ' +
'cookie containing the session data. Use ' +
'config.action_controller.session = { :session_key => ' +
'config.action_controller.session = { :key => ' +
'"_myapp_session", :secret => "some secret phrase" } in ' +
'config/environment.rb'
end
Expand All @@ -181,7 +181,7 @@ def ensure_secret_secure(secret)
if secret.blank?
raise ArgumentError, "A secret is required to generate an " +
"integrity hash for cookie session data. Use " +
"config.action_controller.session = { :session_key => " +
"config.action_controller.session = { :key => " +
"\"_myapp_session\", :secret => \"some secret phrase of at " +
"least #{SECRET_MIN_LENGTH} characters\" } " +
"in config/environment.rb"
Expand Down
2 changes: 1 addition & 1 deletion railties/configs/initializers/session_store.rb
Expand Up @@ -5,7 +5,7 @@
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
ActionController::Base.session = {
:session_key => '_<%= app_name %>_session',
:key => '_<%= app_name %>_session',
:secret => '<%= app_secret %>'
}

Expand Down
2 changes: 1 addition & 1 deletion railties/doc/guides/source/security.txt
Expand Up @@ -93,7 +93,7 @@ That means the security of this storage depends on this secret (and of the diges

....................................
config.action_controller.session = {
:session_key => ‘_app_session’,
:key => ‘_app_session’,
:secret => ‘0x0dkfj3927dkc7djdh36rkckdfzsg...’
}
....................................
Expand Down

0 comments on commit d3107ce

Please sign in to comment.