I\'m putting together a small app which will allow a user to log into a semi-popular social networking site that doesn\'t have a sufficient API, so I\'m using the mechanize
Don't store the agent, just the session cookie. Find the name of the cookie you want to capture. After logging in, grab it from the Mechanize cookie jar, store it in the session, and make sure it's in the cookie jar before every "API request".