本文简要介绍ruby语言中 CGI::Cookie.new
的用法。
用法
new(name_string,*value)
new(options_hash)
创建一个新的 CGI::Cookie
对象。
name_string
-
cookie 的名称;在这种形式中,没有
domain
或到期。path
是从SCRIPT_NAME
环境变量中收集的,而secure
是假的。 *value
-
cookie 的值或值列表
options_hash
-
用于初始化此
Cookie
的选项的Hash
。可能的选项是:- 名字
-
cookie 的名称。必需的。
- 值
-
cookie 的值或值列表。
- 小路
-
此 cookie 适用的路径。默认为
SCRIPT_NAME
环境变量的值。 - 领域
-
此 cookie 适用的域。
- 过期
-
此 cookie 过期的时间,作为
Time
对象。 - 安全的
-
此 cookie 是否是安全 cookie(默认为 false)。安全 cookie 仅传输到 HTTPS 服务器。
- httponly
-
此 cookie 是否为 HttpOnly cookie(默认为
false). HttpOnly cookies are not available to javascript.
这些关键字对应于 cookie 对象的属性。
调用超类方法
Array::new
相关用法
- Ruby Cookie.parse用法及代码示例
- Ruby Cookie类用法及代码示例
- Ruby Context.save_history=用法及代码示例
- Ruby Constants模块用法及代码示例
- Ruby Comparable.between?用法及代码示例
- Ruby Complex.arg用法及代码示例
- Ruby ComposedSet类用法及代码示例
- Ruby Continuation类用法及代码示例
- Ruby Complex.abs2用法及代码示例
- Ruby Context.echo_on_assignment?用法及代码示例
- Ruby Complex.angle用法及代码示例
- Ruby Complex.polar用法及代码示例
- Ruby Comment.extract_call_seq用法及代码示例
- Ruby Comparable.clamp用法及代码示例
- Ruby Complex.to_f用法及代码示例
- Ruby Complex.cmp / numeric用法及代码示例
- Ruby Complex.conj用法及代码示例
- Ruby Converter.primitive_errinfo用法及代码示例
- Ruby Config.get_value用法及代码示例
- Ruby Context.echo?用法及代码示例
- Ruby Command.arguments用法及代码示例
- Ruby Complex类用法及代码示例
- Ruby Complex.infinite?用法及代码示例
- Ruby Complex.abs用法及代码示例
- Ruby Context.echo_on_assignment用法及代码示例
注:本文由纯净天空筛选整理自ruby-lang.org大神的英文原创作品 Cookie.new。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。