Browser DNS balancing effects



I'm trying to work the login process to a website automatically, using
curl's cookie support. So I fire off multiple curl commands which make use
of the same cookie jar, one to the login page, one with my username and
password, and then some more to the site after I've logged in.

What I've noticed is that occasionally the site returns back 'Session lost'
errors at random, claiming that my session has expired when I've only just
logged in. I'm definitely sending the cookie that it gave me.

This doesn't ever happen with a web browser. I notice the DNS entry for the
site is similar to:
login.example.com. 588 IN A 1.2.3.4
login.example.com. 588 IN A 5.6.7.8

It could be that my curl requests are hitting a different server each time,
and there isn't any login-coherency between the two servers (so the cookie
sent by 1.2.3.4 isn't recognised if I send it to 5.6.7.8). It's not the
best written of sites, so this wouldn't surprise me.

So what I wondered is how do browsers handle the case of multiple A records?
Do they pick one and use it for all transactions to that site? Is that
defined behaviour? I know some browsers have their own DNS caching, but
does this cache one or both of the A records? Does they (I'm testing with
mostly Mozilla-based browsers) pick one address but expire it after the TTL?
I read that some browsers ignore the TTL and have their own timeout (to
avoid DNS poisoning), but how does this interact with multiple A records?

Thanks
Theo
.



Relevant Pages

  • Re: WWW-Authenticate: How to force password login at every page refresh ?
    ... > How can I force the page to prompt for a password at every refresh? ... Browsers are designed to work like this so people don't need to ... is use this in combination with a cookie. ... password then you know this is the second request, ...
    (comp.lang.php)
  • Re: Browser DNS balancing effects
    ... curl's cookie support. ... I notice the DNS entry for the ... It could be that my curl requests are hitting a different server each time, ... So what I wondered is how do browsers handle the case of multiple A records? ...
    (uk.comp.os.linux)
  • Cant relogin to site - apparently, its PHPs fault! What do I tell them?
    ... web host and myself, then tell me what I can tell them! ... Tried it with 3 browsers now, and the ... > It sets a cookie, PHPSESSID, with a value. ... we are using a PHP Session ID and this is the way they work. ...
    (comp.lang.php)
  • Re: Bug in forms authentication?
    ... Isn't the auth token saved as a cookie. ... You are right that sessions and form authentication are separated ... when I'm connecting from two IE browsers it _is ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Perl Cookies
    ... >> used ';', or any other character, to separate the multiple values in ... >> your cookie, and it would have escaped everything properly. ... > want multiple values in the same cookie, ...
    (comp.lang.perl.misc)