Ruby 2.2.0 リファレンスマニュアル > ライブラリ一覧 > webrick/cookieライブラリ > WEBrick::Cookieクラス

class WEBrick::Cookie

クラス・モジュールの継承リスト: WEBrick::Cookie < Object < Kernel < BasicObject

要約

Cookie を表すクラスです。[RFC2109] に準拠しています。 RFC2109 は [RFC2965] により破棄されましたが、WEBrick::Cookie クラスは RFC2965 に対応していません。

特異メソッド

定義 説明
new(name, value) -> WEBrick::Cookie

新しい WEBrick::Cookie オブジェクトを生成して返します。 name にクッキーの名前を、value にクッキーで保持する値を与える。

parse(str) -> [WEBrick::Cookie]

ユーザーエージェントから送られてきた Cookie ヘッダの値 str をパースし、新しく WEBrick::Cookie オブジェクトを生成しその配列を返します。各属性の形式が仕様に準拠しているかを確認しません。

parse_set_cookie(str) -> WEBrick::Cookie

サーバから送られてくる Set-Cookie ヘッダの値 str をパースし、新しく WEBrick::Cookie オブジェクトを生成し返します。

parse_set_cookies(str) -> [WEBrick::Cookie]

サーバから送られてくる Set-Cookie ヘッダの値 str をパースし、新しく WEBrick::Cookie オブジェクトの配列を生成し返します。

インスタンスメソッド

定義 説明
comment -> String
comment=(value)

コメントを文字列で表すアクセサです。

domain -> String
domain=(value)

ドメイン名を文字列で表すアクセサです。

expires -> Time
expires=(value)

有効期限を Timeオブジェクトで表すアクセサです。

max_age -> Integer
max_age=(value)

クッキーの寿命を整数(単位は秒)で表すアクセサです。

name -> String

Cookie の名前を文字列で返します。

path -> String
path=(value)

パス名を文字列で表すアクセサです。

secure -> bool
secure=(value)

クッキーのSecure属性を真偽値で表すアクセサです。

to_s -> String

クッキーを文字列にして返します。

value -> String
value=(str)

クッキーの値を文字列で表すアクセサです。

version -> Integer
version=(value)

Cookie のバージョン番号を整数で表すアクセサです。

継承したメソッド

! != __id__ __send__ instance_eval instance_exec method_missing singleton_method_added singleton_method_removed singleton_method_undefined !~ <=> == === =~ _dump class clone define_singleton_method display enum_for eql? equal? extend freeze frozen? hash initialize initialize_copy inspect instance_of? instance_variable_defined? instance_variable_get instance_variable_set instance_variables is_a? itself marshal_dump marshal_load method methods nil? object_id pretty_inspect pretty_print pretty_print_cycle pretty_print_inspect pretty_print_instance_variables private_methods protected_methods psych_to_yaml public_method public_methods public_send remove_instance_variable respond_to? respond_to_missing? send singleton_class singleton_method singleton_methods taint tainted? tap to_a to_ary to_hash to_int to_io to_proc to_regexp to_str trust untaint untrust untrusted? .yaml_tag ::ARGF ::ARGV ::DATA ::ENV ::FALSE ::NIL ::RUBY_COPYRIGHT ::RUBY_DESCRIPTION ::RUBY_ENGINE ::RUBY_PATCHLEVEL ::RUBY_PLATFORM ::RUBY_RELEASE_DATE ::RUBY_REVISION ::RUBY_VERSION ::SCRIPT_LINES__ ::STDERR ::STDIN ::STDOUT ::TOPLEVEL_BINDING ::TRUE