[英]How to get request headers cookie in rails 5 api
Im trying to get the cookies, from the controller, with puts request.headers['Cookie']
and nothing is showing in my terminal. 我正在尝试通过puts request.headers['Cookie']
从控制器获取cookie,但是终端没有任何显示。
My see the details in chrome tools: 我在chrome工具中看到了详细信息:
How to get the cookie, please? 请问如何获得cookie?
Edit 编辑
try this 尝试这个
request.headers["Cookie"]
http://api.rubyonrails.org/classes/ActionDispatch/Request.html#method-i-headers http://api.rubyonrails.org/classes/ActionDispatch/Request.html#method-i-headers
只用饼干
puts cookies[:name]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.