我的系统是Debian lenny 5.0.4,Quixote使用的是默认安装。
cookie中的session值(也可能是session_id值,或者其他)带双引号,服务器端提取session值时稍微有点费事,就hack了quixote的源代码去除了双引号,方法如下:
debian:~#vim /usr/share/python-support/python-quixote/quixote/http_response.py
367 def _gen_cookie_headers(self): 368 """_gen_cookie_headers() -> [string] 369 370 Build a list of "Set-Cookie" headers based on all cookies 371 set with 'set_cookie()', and return that list. 372 """ 373 cookie_headers = [] 374 for name, attrs in self.cookies.items(): 375 value = str(attrs['value']) 376 if '"' in value: 377 value = value.replace('"', '//"') 378 chunks = ['%s="%s"' % (name, value)] 379 for name, val in attrs.items(): 380 name = name.lower() 381 if val is None: 382 continue 383 if name in ('expires', 'domain', 'path', 'max_age', 'comment'): 384 name = name.replace('_', '-') 385 chunks.append('%s=%s' % (name, val)) 386 elif name == 'secure' and val: 387 chunks.append("secure") 388 cookie_headers.append(("Set-Cookie", '; '.join(chunks).replace('"', ''))) 389 return cookie_headers
将388行改为:
388 cookie_headers.append(("Set-Cookie", '; '.join(chunks).replace('"', '')))
替换掉chunks中的双引号,重启服务器即可