2003-05-01 (Thu) めちゃさむい
〆 [tdiary]xreaとcookieその1
xreaでmod_layoutを使った場合に動作がおかしくなる以外にも
- ツッコミでの「お名前」が記憶されない
- what's newプラグインを使うとNewが消えない
等のcookieがらみの問題がいわれているので少しだけ調査。
明示的にindex.rbにアクセスするとうまくいきますね。ディレクトリにアクセスするとset-cookieが抜けてしまっているような。
調査続行(予定)。
〆 [tdiary]xreaとcookieその2
次のコードを実行してみました。
#!/usr/local/bin/ruby
require 'net/http'
host = 'shimoi.s26.xrea.com'
path = '/ydiary/'
begin
Net::HTTP.start( host, 80 ) {|http|
response , = http.get(path)
response.each do |key, value|
puts "#{key} = #{value}"
end
}
end
path = '/ydiary/index.rb'の場合
cache-control = no-cache
connection = close
content-type = text/html
date = Wed, 30 Apr 2003 18:18:37 GMT
server = Apache
set-cookie = tdiary_whats_new=20030501001; path=/ydiary/;
expires=Tue, 29 Jul 2003 18:18:37 GMT
transfer-encoding = chunked
pragma = no-cache
path = '/ydiary/'の場合
cache-control = no-cache connection = close content-type = text/html date = Wed, 30 Apr 2003 18:20:29 GMT server = Apache transfer-encoding = chunked
でした。cgi.rbを読まないといけないのかな?
〆 [tdiary]xreaとcookieその3
原因を探るのはたいへんそうなので、
RewriteEngine on RewriteBase /ydiary/ RewriteRule ([0-9]+)\.html$ index.rb?date=$1 RewriteRule ^$ index.rb
としました。ポイントは最後の行。
いちおう、ydiary/へアクセスしてもcookieが働くようになった気がします。他のxreaerの方々はどうでしょう?
〆 [tdiary]xreaとcookie番外編
タイミングよくkosakaさんが広告免除の試用をしていたので調査。
path = '/diary/'の場合
last-modified = Thu, 01 May 2003 01:24:29 GMT vary = User-Agent cache-control = no-cache connection = close content-type = text/html; charset=EUC-JP date = Thu, 01 May 2003 01:37:50 GMT server = Apache content-length = 17388 pragma = no-cache
path = '/diary/index.cgi'の場合
last-modified = Thu, 01 May 2003 01:24:29 GMT vary = User-Agent cache-control = no-cache connection = close content-type = text/html; charset=EUC-JP date = Thu, 01 May 2003 01:41:16 GMT server = Apache content-length = 17388 pragma = no-cache
whats_newプラグインがないのでcookiesは表示されていませんがどちらの結果でも問題なし。