简体   繁体   English

如何在Rails 5 API中获取请求标头cookie

[英]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 编辑

See gist for header response . 有关标题响应,请参见要点

只用饼干

puts cookies[:name]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM