0

Webサーバーで動作するスクリプトを書いています。

だから、私は次のコードを持っています:

client = suds.client.Client(WSDLfile)
client.service.Login('mylogin', 'mypass')
print client.options.transport.cookiejar
#######
sessnum = str(client.options.transport.cookiejar).split(' ')[1]
client = suds.client.Client( WSDLfile, headers= { 'Set-Cookie' : sessnum } )

FreeBSD で実行すると、戻ります

<cookielib.CookieJar[<Cookie sessnum=9WAXQ25D37XY535F6SZ3GXKSCTZG8CVJ for .IP.IP.IP.IP/>]>

しかし、Windowsではそれが返されます

<cookielib.CookieJar[]>

どうすれば修正できますか?

4

1 に答える 1

2

AFAIK client.options.transport.cookiejar は反復可能であるため、次の場合に各システムで何が起こりますか:

for c in client.options.transport.cookiejar:
    print client.options.transport.cookiejar

それができない場合、Windows システムで Cookie が許可されていない場合はどうなるでしょうか? これにより、セッションが保存されなくなる場合があります。

于 2010-05-28T11:00:05.957 に答える