aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorChad Jolly <cjolly@lawgical.com>2012-04-21 14:03:23 -0600
committerChad Jolly <cjolly@lawgical.com>2012-04-21 14:03:23 -0600
commit3527852dba6e68eca1c4ed3d8024c10e6a0ec008 (patch)
treea17a36c2c0b2f56e326304bf6eed6393c6bf9fa4 /actionpack/lib
parenta719843d31042690fa4fa8f55bc8a647d360b2a8 (diff)
downloadrails-3527852dba6e68eca1c4ed3d8024c10e6a0ec008.tar.gz
rails-3527852dba6e68eca1c4ed3d8024c10e6a0ec008.tar.bz2
rails-3527852dba6e68eca1c4ed3d8024c10e6a0ec008.zip
Improve signed cookies documentation
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_dispatch/middleware/cookies.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/cookies.rb b/actionpack/lib/action_dispatch/middleware/cookies.rb
index 0c717c8503..551e39eb33 100644
--- a/actionpack/lib/action_dispatch/middleware/cookies.rb
+++ b/actionpack/lib/action_dispatch/middleware/cookies.rb
@@ -29,6 +29,7 @@ module ActionDispatch
# # Sets a signed cookie, which prevents a user from tampering with its value.
# # The cookie is signed by your app's <tt>config.secret_token</tt> value.
# # Rails generates this value by default when you create a new Rails app.
+ # # Signed cookies must read with the signed method <tt>cookies.signed[:key]</tt>
# cookies.signed[:user_id] = current_user.id
#
# # Sets a "permanent" cookie (which expires in 20 years from now).
@@ -39,9 +40,10 @@ module ActionDispatch
#
# Examples for reading:
#
- # cookies[:user_name] # => "david"
- # cookies.size # => 2
- # cookies[:lat_lon] # => [47.68, -122.37]
+ # cookies[:user_name] # => "david"
+ # cookies.size # => 2
+ # cookies[:lat_lon] # => [47.68, -122.37]
+ # cookies.signed[:login] # => "XJ-122"
#
# Example for deleting:
#