# Sets a simple session cookie.
# This cookie will be deleted when the user's browser is closed.
# Assign an array of values to a cookie.
cookies[:lat_lon] = [47.68, -122.37]
cookies[:login] = { :value => "XJ-122", :expires => 1.hour.from_now }
:path 设定cookie有效的路径。没有验证过怎么使用,但是应该是指cookie在哪一层目录下有效吧,这样可以防止不同的controller之间的同名cookie。
:domain 设定cookie在哪些域名下有效。
:secure true/false,标识是否传递给https server。
:httponly 顾名思义吧
cookies.signed[:user_id] = current_user.id
signed cookie,防止用户篡改其值(没试过,不知道理解的对不对)
cookies.permanent[:login] = "XJ-122"
permanent cookie,有效期20年的cookie
==============================================================