【发布时间】:2016-06-06 13:46:14
【问题描述】:
我正在尝试将数据保存在 cookie 中以供以后使用。
def hello
name = SecureRandom.hex
cookies[:cookies_name] = name
.....
end
def process_file
logger.debug "The number of lines in specific is updr #{cookies[:cookies_name] }"
...
end
在action process_file中,我存储在cookies中的值是空格(nil)。此外,当我尝试查看 cookie 时使用开发人员工具(Chrome -> 开发人员工具 -> 资源),我看不到任何 cookie。
如何设置 cookie?
【问题讨论】:
标签: ruby-on-rails cookies