开发者

Store cookie from HTTP header

开发者 https://www.devze.com 2023-01-01 10:40 出处:网络
How do you store a cookie with basic info. i.e. link is http://www.domain.com/index.html?ref=123 How would I store a cookie with 开发者_如何学Cname of \"ref\" and the value of \"123\"?see http://api

How do you store a cookie with basic info.

i.e. link is http://www.domain.com/index.html?ref=123

How would I store a cookie with 开发者_如何学Cname of "ref" and the value of "123"?


see http://api.rubyonrails.org/classes/ActionController/Cookies.html

use following code in your controller:

cookies[:ref] = 123

or

cookies[:ref] = params[:ref]
0

精彩评论

暂无评论...
验证码 换一张
取 消