これは、スクリプトで発生することです。HTTP の問題ではありません。リダイレクトは、同じメソッド (307/308) またはGET
(302/303) で発行されたリクエストになります。リダイレクトされたGET
は決してPOST
;にはなりません。したがって、問題はログアウト スクリプトのリダイレクトとは関係ありません。
あなたの場合、schedule-so.php にはある種のタイムゾーン検出コードがあるようです。何が起こるかは次のとおりです。
まずログアウトします。
GET http://dev.bridgebase.com/barmar_test/new_vugraph/webutil.php?op=logout HTTP/1.1
Host: dev.bridgebase.com
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.56 Safari/537.4
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Referer: http://dev.bridgebase.com/barmar_test/new_vugraph/schedule-so.php
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8,es;q=0.6
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: PHPSESSID=ub7ov6vvsrrpgq0g7cdoieqne3
これにより、期待どおりのリダイレクトが行われます。
HTTP/1.1 302 Moved Temporarily
Server: nginx/1.2.1
Date: Fri, 14 Sep 2012 23:00:38 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
X-Powered-By: PHP/5.4.3-6
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Location: http://dev.bridgebase.com/barmar_test/new_vugraph/schedule-so.php#
0
ブラウザGET
の schedule-so.php。
GET http://dev.bridgebase.com/barmar_test/new_vugraph/schedule-so.php HTTP/1.1
Host: dev.bridgebase.com
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.56 Safari/537.4
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Referer: http://dev.bridgebase.com/barmar_test/new_vugraph/schedule-so.php
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8,es;q=0.6
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: PHPSESSID=ub7ov6vvsrrpgq0g7cdoieqne3
次に、schedule-so.php は、自動送信されるフォームで応答します。
HTTP/1.1 200 OK
Server: nginx/1.2.1
Date: Fri, 14 Sep 2012 23:00:38 GMT
Content-Type: text/html
Connection: keep-alive
Vary: Accept-Encoding
X-Powered-By: PHP/5.4.3-6
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Pragma: no-cache
Cache-control: private
Content-Length: 989
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<script type="text/javascript">
function get_tz()
{
var now = new Date()
document.tz_form.offset.value = now.getTimezoneOffset()
document.tz_form.submit()
}
</script>
<object><noscript>
<p> Javascript support is needed for this page (to get your local timezone).<br />
Your browser either has no Javascript support,
or has such support disabled.<br />
As an alternative, click <a href="http://dev.bridgebase.com/barmar_test/new_vugraph/schedule-so.php?offset=0">here</a> to continue.<br />
All times will be GMT.</p> </noscript></object>
</head>
<body onload='get_tz()'>
<form name="tz_form" action="/barmar_test/new_vugraph/schedule-so.php" method="post">
<input type='hidden' name='offset' />
</form>
</body>
</html>
...そしてonload
、JavaScript によってフォームが送信されます。これが のPOST
由来です。
POST http://dev.bridgebase.com/barmar_test/new_vugraph/schedule-so.php HTTP/1.1
Host: dev.bridgebase.com
Connection: keep-alive
Content-Length: 10
Cache-Control: max-age=0
Origin: http://dev.bridgebase.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.56 Safari/537.4
Content-Type: application/x-www-form-urlencoded
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Referer: http://dev.bridgebase.com/barmar_test/new_vugraph/schedule-so.php
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8,es;q=0.6
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: PHPSESSID=ub7ov6vvsrrpgq0g7cdoieqne3
offset=240
いよいよスケジュールページに着陸。
HTTP/1.1 200 OK
Server: nginx/1.2.1
Date: Fri, 14 Sep 2012 23:00:38 GMT
Content-Type: text/html
Connection: keep-alive
Vary: Accept-Encoding
X-Powered-By: PHP/5.4.3-6
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Pragma: no-cache
Cache-control: private
Content-Length: 35892
...
そのためget_tz()
、schedule-so.php を探して、ブラウザに送信される理由を調べる必要があります。私の推測では、ユーザーのタイムゾーンはセッションに保存されていると思います (ログアウト時に無効になります)。
HTTP 要求で何が起こっているかをよりよく理解するには、Fiddlerを使用します。