title: how to log in a Drupal user (or get currently-logged in user) from Flex/Flash?
body: <p>I have a Flash application that is hosted from within a Drupal page.  Some parts of the Flash application should be available to all users, but some should only be available to a logged-in user.  (The specific role doesn't matter, just that they are any authorized user of the site).</p>
  
  <p>From within Flash, I can detect whether the user is logged on by screen-scraping the "?q=user" page, but this is very brittle.  What is the "right" way to do this?  I can install additional Modules if necessary, but they need to be compatible with Drupal 6, not 5.</p>
  
  <p>Similarly, if there is no user currently logged in, how can I take a username and password that they provide to me and log them in (or determine that the password is bad)?</p>