The script will be run under the context of a plugin, which means that it will have access to all system components, allowing you to login in the most optimal way -- be that via a real browser, via HTTP requests, by loading an external cookie-jar file and many more.