PDA

View Full Version : Unset cookies before 302 redirect with phpLsapi


IO
09-26-2005, 05:08 PM
I use a php script to unset some cookies (for log-out).
At the end of the script there is a header('Location: ...);

It work fine with phpFcgi but the cookies are randomly unset with phpLsapi.

mistwang
09-26-2005, 06:56 PM
Thank you for the bug report.

Does the unset always work if no Location header?
Can this be tested with wget or lynx?

It will be great if you can provide a test script.

IO
09-26-2005, 07:45 PM
I make some tests, the cookies seem to be always sent, but there is a difference between the headers :

phpFcgi (Always Work) :
1 HTTP/1.0 302 Found
2 Content-type: text/html
3 Set-Cookie: one=deleted; expires=Mon, 27 Sep 2004 01:24:25 GMT; path=/
4 Set-Cookie: two=deleted; expires=Mon, 27 Sep 2004 01:24:25 GMT; path=/
5 Location: http://www.redirect.com/
6 Content-Encoding: gzip
7 Vary: Accept-Encoding
8 Content-Length: 20
9 Server: LiteSpeed
10 Date: Tue, 27 Sep 2005 01:24:25 GMT
11 Connection: close
phpLsapi (Work Randomly) :
1 HTTP/1.0 302 Found
2 Set-Cookie: one=deleted; expires=Mon, 27 Sep 2004 01:23:05 GMT; path=/
3 Set-Cookie: two=deleted; expires=Mon, 27 Sep 2004 01:23:05 GMT; path=/
4 Location: http://www.redirect.com/
5 Content-type: text/html
6 Content-Encoding: gzip
7 Vary: Accept-Encoding
8 Content-Length: 20
9 Server: LiteSpeed
10 Date: Tue, 27 Sep 2005 01:23:06 GMT
11 Connection: close
I don't think the place of Content-type: text/html is important :?
And I can't remove it (it's not necessary for a redirect) because it is defined in php.ini

mistwang
09-29-2005, 07:11 PM
I think we had found the bug, can you please download http://www.litespeedtech.com/lsapi/litespeed-1.4.tgz and give it a try.

Not sure about the "corrupted double-linked list with RHEL4" problem though.

Thanks,
George

IO
10-06-2005, 06:17 PM
It work nice with 1.5 patch.

There is also no error "corrupted double-linked list with RHEL4" with the new patch and lsws 2.1.2

Good job :!: :wink: