Foren: Offene Diskussion (Thread #1753)

Cookieオブジェクトについて (2003-01-12 01:54 by anony #3438)

cookieのデータそのものを得るにはどうすればいいのでしょうか。

http = new HTTP;

url = new URL( どこかのURL );

http.request( 'GET', url.url );
http.response();

alert( http.responseHeader.cookie );

としても、[cookie]と返されてしまいます。
http.responseHeader.cookie.getKeys();
としても、それらしい物が見つかりません。

Reply to #3438×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden

RE: Cookieオブジェクトについて (2003-01-12 11:22 by preneco #3446)

ども。

responseHeader.cookie は、cookieオブジェクトなので、マニュアルのそこの情報を参照すれば、うまくいくと思います。

ためしに、alertのところを
alert( http.responseHeader.cookie.domain );
とかやってみてくださいな~。
Reply to #3438

Reply to #3446×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden

RE: Cookieオブジェクトについて (2003-01-12 17:50 by anony #3450)

こんにちは。

例えば、
Set-Cookie: B=8rmsl1ov22aic&b=2; expires=Thu, 15 Apr 2010 20:00:00 GMT; path=/; domain=.yahoo.co.jp
と返された場合、僕が欲しい情報は
B=8rmsl1ov22aic&b=2
なのですが、その情報をどうやって得ればいいのかがわからないのです。

alert( http.responseHeader.cookie.getProperties() );
とすると、
domain
expires
path
と返されるので。

responseHeader['Set-Cookie']も、ないようですし。
Reply to #3438

Reply to #3450×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden

RE: Cookieオブジェクトについて (2003-01-12 22:11 by preneco #3454)

ごめんなさい。言っていることをよく理解していなかったみたいですね。

しかし、ざっと見たところ Cookieと responseHeaderでは取り出せそうになさそ
うですね。どうしたらいいんだろ..。

とりあえず、メソッドを拡張して、値が取り出せるように書き換えちゃいます?
Reply to #3450

Reply to #3454×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden

RE: Cookieオブジェクトについて (2003-01-13 00:44 by gaogao #3459)

Cookieオブジェクト修正しました。
a = new HTTP;
a.debug = true;
a.get('http://www.google.co.jp/');
println(a.responseHeader.cookie);
for(i in a.responseHeader.cookie)
println(i + ': ' + a.responseHeader.cookie[i]);

どうも、prenecoさん。長い間この掲示板見てなくてすみません。
とりあえず、googleでdmonkeyを検索してみてください。
Reply to #3454

Reply to #3459×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden

RE: Cookieオブジェクトについて (2003-01-13 12:17 by preneco #3466)

おおっ。Wolfyさん、お久しぶりです。
いろいろ納得です(笑)
Reply to #3454

Reply to #3466×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden