I think the easiest way is to use HTTP Authentication. That way, you can send the user's credentials on the HTTP request without any additional hassle.
The other option is to make a POST request to the login action (the one the login form would usually POST to) and then pass the session cookies around, but that's more cumbersome.