AN HTTPD ゲストブック/コメント集(2001年10月24日11:34)


中田昭雄 nakata@st.rim.or.jp 2001/10/25 21:40

アリスさん、
Location: の件、
順番によってそうなるということでいいのかどうかは確認しようと思っています。


アリス nanase@syotake.to 2001/10/25 11:53

::中田昭雄さん::
ご回答ありがとうございました。
なるほど、Set-Cookieの位置だったとは・・・・
症状解決しました、本当にありがとうございました。


中田昭雄 nakata@st.rim.or.jp 2001/10/24 21:33

アリスさん、

print "Set-Cookie: ..."
の前に、

if ($ENV{'PERLXS'}) {
print "HTTP/1.0 302 Temporary Redirection\n";
}

を入れてみてください。
ISAPI で Location: ヘッダを出すもので Location: ヘッダ以外のヘッダを出す時には、NPH スクリプトのようにステータスラインから出力する必要があるようです。

もっとも perl.exe での出力もちょっと変ですし、ISAPIの仕様もそれでいいのかどうか自信はないので、調べてみます。


アリス nanase@syotake.to 2001/10/24 11:34

最新Verで使っているのですがPerlIS.dllで動かしたときLocationがうまくいきません。

<<< s=644: Wed Oct 24 11:30:53 2001 <<<
POST /cgi-bin/golf/gatex.cgi HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/msword, */*
Referer: http://127.0.0.1/cgi-bin/golf/gatex.cgi
Accept-Language: ja
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Host: 127.0.0.1
Content-Length: 51
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: gatex_html=id:nanase@syotake.to,pw:misaki

action=gate&id=nanase@syotake.to&pw=misaki&mode=chk
>>> s=644: Wed Oct 24 11:30:53 2001 >>>
HTTP/1.1 200 OK
>>> s=644: Wed Oct 24 11:30:53 2001 >>>
Date: Wed, 24 Oct 2001 02:30:53 GMT
>>> s=644: Wed Oct 24 11:30:53 2001 >>>
Server: AnWeb/1.36b
>>> s=644: Wed Oct 24 11:30:53 2001 >>>
Set-Cookie: gatex_html=id:nanase@syotake.to,pw:mi
>>> s=644: Wed Oct 24 11:30:53 2001 >>>
saki; expires=Friday, 23-Nov-2001 02:30:53 GMT
>>> s=644: Wed Oct 24 11:30:53 2001 >>>
HTTP/1.0 302 Temporary Redirection
>>> s=644: Wed Oct 24 11:30:53 2001 >>>
Content-type: text/html
>>> s=644: Wed Oct 24 11:30:53 2001 >>>
Location: ./mypage.cgi?id=nanase_syotake.to&pw=misaki
>>> s=644: Wed Oct 24 11:30:53 2001 >>>
Transfer-Encoding: chunked
>>> s=644: Wed Oct 24 11:30:53 2001 >>>

>>> s=644: Wed Oct 24 11:30:53 2001 >>>
0

Perl.exeで動かした場合はうまくいきます。
<<< s=468: Wed Oct 24 11:32:59 2001 <<<
POST /cgi-bin/golf/gatex.cgi HTTP/1.1
Accept: */*
Referer: http://127.0.0.1/cgi-bin/golf/gatex.cgi
Accept-Language: ja
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Host: 127.0.0.1
Content-Length: 51
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: gatex_html=id:nanase@syotake.to,pw:misaki

action=gate&id=nanase@syotake.to&pw=misaki&mode=chk
>>> s=468: Wed Oct 24 11:32:59 2001 >>>
HTTP/1.1 302 Found
MIME-Version: 1.0
Server: AnWeb/1.36b
Date: Wed, 24 Oct 2001 02:32:59 GMT
Transfer-Encoding: chunked
Pragma: no-cache
Last-Modified: Wed, 24 Oct 2001 02:32:59 GMT
>>> s=468: Wed Oct 24 11:32:59 2001 >>>
Set-Cookie: gatex_html=id:nanase@syotake.to,pw:misaki; expires=Friday, 23-Nov-2001 02:32:59 GMT
HTTP/1.0 302 Temporary Redirection

Content-type: text/html
Location: http://127.0.0.1/cgi-bin/golf/mypage.cgi?id=nanase_syotake.to&pw=misaki

>>> s=468: Wed Oct 24 11:32:59 2001 >>>
0
以上のようなトレースが残ってます。

Locationの使い方が間違っているのでしょうか?
ご回答よろしくお願いいたします。