From 3527852dba6e68eca1c4ed3d8024c10e6a0ec008 Mon Sep 17 00:00:00 2001 From: Chad Jolly Date: Sat, 21 Apr 2012 14:03:23 -0600 Subject: Improve signed cookies documentation --- actionpack/lib/action_dispatch/middleware/cookies.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'actionpack/lib/action_dispatch/middleware') 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 config.secret_token value. # # Rails generates this value by default when you create a new Rails app. + # # Signed cookies must read with the signed method cookies.signed[:key] # 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: # -- cgit v1.2.3