[Mono-devel-list] Possible Mono networking problem

Ronnie Holm r_holmes at yahoo.com
Tue Mar 1 11:13:56 EST 2005


I'm writing a simple application in C# that logs into a Yahoo Mail account by 
simulating a browser. 

During the login process, it is redirected (through the http header) through a 
number of servers until it finally reaches the inbox, if successful. To each 
server it feeds the cookies received so far.

However, I can't get the login process to work with Mono (1.0.5, debian 
unstable). With .Net-runtime on Windows, it works perfectly.

If we look at the trace() output running the application on Windows, it 
reaches my inbox at step 14:

1: Logging into Yahoo Mail with username 'r_holmes' and password 'xxxx'
2: Opening 
'http://mail.yahoo.com/config/login?.intl=us&.us=ym&.tries=1&.src=ym&login=r_holmes&passwd=xxxx'
3: UpdateCookieCollection()
4: No previous cookies stored. Store all cookies
5:    B 4fuqucl12920k&b=2
6:    F a=J06ons0sva8HnAxcQd0gGflizzgSbIkvrjqtKkO_UelR1SmfYg.SzWz1NeVd&b=_DjV
7:    Y v=1&n=frfgoo6e3klnv&l=h_7ebc4i/o&p=m2evvdk013000000&jb=16|23|
3&ig=0f1kb&iz=5932&r=2d&lg=us&intl=us&np=1
8:    T 
z=UgIJCBUmdJCBBifXWTwKl.iMjMxBjYzMTYxNE8xNw--&a=QAE&sk=DAAhBq4AhwE.1m&d=c2wBTlRRMkFURTBOakUyTXpnMk1BLS0BYQFRQUUBaWcBVjNTVEJBAXRpcAFRZEtfaEQBenoBVWdJSkNCZ1dB
9: Redirecting to 
'http://login.yahoo.com/config/verify?.done=http%3a//us.f546.mail.yahoo.com/ym/login%3f.rand=01gj9h49dpaih'
10: Setting up cookies to sent with the request
11: Opening 
'http://login.yahoo.com/config/verify?.done=http://us.f546.mail.yahoo.com/ym/login?.rand=01gj9h49dpaih'
12: Redirecting to 
'http://us.f546.mail.yahoo.com/ym/login?.rand=01gj9h49dpaih'
13: Setting up cookies to sent with the request
14: Opening 'http://us.f546.mail.yahoo.com/ym/login?.rand=01gj9h49dpaih'
15: UpdateCookieCollection()
16:    Adding new key/value pair: 
'YM.Gen'/'i=vaJ46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TD1hdcsayzVL7jMifCzE3cnGLpSkMcdKHMQPvLd2dX9SVQlhV2u.zHmBECpiRUYT6WGpMBzvfAML7SFt0BCHztoHyHxeLeoPvFKiurzTPe3eroy.SQtvR0lsJ4e4k30dxqWFYxuHJ2dblV3YJLnnW5v4l7xcKEIDFe0Y.WsVEH9PmA_Ojw4BCi8BI17IDNCG_lZ40XEu557ihM94z9biQg8XkhkjGtjNw9ys9T1heRI50L9K8OoODxxdyCFPYa1n4i51oiymPpTicfMZ5vGHvC8pr5PLN8qEQJ5aWo0zCKRIcESW..8cCi815aZL9QHCB70GYMusTEJtykLLkIaIVxnBtkpSiOEfQYQJbZd1wu.SP.qNQ-&v=1'

And then running the same application on linux:

1: Logging into Yahoo Mail with username 'r_holmes' and password 'xxxx'
2: Opening 
'http://mail.yahoo.com/config/login?.intl=us&.us=ym&.tries=1&.src=ym&login=r_holmes&passwd=xxxx'
3: UpdateCookieCollection()
4: No previous cookies stored. Store all cookies
5:    B 18dft0h12937r&b=2
6:    F a=J06ons0sva8HnAxcQd0gGflizzgSbIkvrjqtKkO_UelR1SmfYg.SzWz1NeVd&b=_DjV
7:    Y v=1&n=frfgoo6e3klnv&l=h_7ebc4i/o&p=m2evvdk013000000&jb=16|23|
3&ig=0f1kb&iz=5932&r=2d&lg=us&intl=us&np=1
8:    T 
z=7zIJCB75dJCBIjtUO2esw7qMjMxBjYzMTYxNE8xNw--&a=QAE&sk=DAA.qR.7d3F3JI&d=c2wBTlRRMkFURTBOakUyTXpnMk1BLS0BYQFRQUUBaWcBVjNTVEJBAXRpcAFRZEtfaEQBenoBN3pJSkNCZ1dB
9: Redirecting to 
'http://login.yahoo.com/config/verify?.done=http%3a//us.f546.mail.yahoo.com/ym/login%3f.rand=8eb8bof6cj070'
10: Setting up cookies to sent with the request
11: Opening 
'http://login.yahoo.com/config/verify?.done=http://us.f546.mail.yahoo.com/ym/login?.rand=8eb8bof6cj070'

Step 11 sends me back to the login page instead of to my inbox. The Yahoo 
error message viewing the URL of step 11 is "The browser you're using refuses 
to sign in. (cookies rejected)". I'm not sure this really is a cookie 
problem, though.

I've inspected what is actually going on with Ethereal. As a response to 
opening the URL of step 9 of the linux output, the Yahoo server responds 
with:

HTTP/1.1 200 OK[Unreassembled Packet]

On Windows, the response is:

HTTP/1.1 302 Found (text/html)

Is something wrong with my application or is it the Mono runtime? 

I've attached a stripped down version of my application. Obviously my password 
isn't xxxx, so running the application will fail on Windows as well :O)

Ronnie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: YahooDrive.cs
Type: text/x-c++src
Size: 3756 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050301/9b8a9961/attachment.bin 


More information about the Mono-devel-list mailing list