How to log in to the API
First, your programming language of choice should have some API for automating interacting with webpages intelligently.
I'm a Perl programmer so I'm using WWW::Mechanize. It manages a www session and cookies for me and allows me to select a form, input fields and press form buttons on webpages really easily. I know ruby has a mechanize, and there's probably a python port too. I avoid microsoft languages & java like the plague. That said, this information should be able to get you on the right track no matter your language.
We're going to start with the base D&D Insider page, because this is where the login form is:
Dungeons & Dragons Roleplaying Game Official Home Page
On this page we want to work with the 'aspnetForm'
Username field: 'ctl00$ctl00$ctl00$ctl00$SiteContent$DnDContent$ctl00$UserName'
Password field: 'ctl00$ctl00$ctl00$ctl00$SiteContent$DnDContent$ctl00$UserPassword'
Login button: 'ctl00$ctl00$ctl00$ctl00$SiteContent$DnDContent$ctl00$LoginButton'
With WWW::Mechanize I can just populate the appropriate fields and say $mech->click($login_button) and I'm logged in.
The cookie for testing whether or not you are logged in is '.ASPXAUTH'
You can logout by going back to the original page, and if you're logged in the Login button ('ctl00$ctl00$ctl00$ctl00$SiteContent$DnDContent$ctl00$LoginButton') is the same one to 'click' to logout. When you do this the '.ASPXAUTH' cookie is cleared.
When logged in using the same mechanize instance, I can $mech->get($compendium_item_uri) and I can get the content of a compendium uri and get the actual results, and not the pesky log in content.
Check out my WIP:
mnology's perl-ddi-compendium at master - GitHub for some real code.