# File wikibot.rb, line 39
        def login
                
                post_me = {'lgname'=>@config.user_name,'lgpassword'=>@config.password}
                
                result = make_request('login', post_me)
                
                # Now we need to changed some @config stuff, specifically that we're logged in and the variables of that
                # This will also change the make_request, but I'll comment there
                login_element = result.get_elements('/api/login').first
                result = login_element.attribute('result').to_s
                if result.eql?('Success') then
                        # All lg variables are directly from API and stored in config that way
                        @config.logged_in = true
                        @config.user_id = login_element.attribute('lguserid').to_s
                        @config.lgtoken = login_element.attribute('lgtoken').to_s
                        @config.cookie_prefix = login_element.attribute('cookieprefix').to_s
                        @config.session_id = login_element.attribute('sessionid').to_s
                        $stderr.puts 'Bot logged in.'
                        return true
                else
                        raise MediaWikiApiError,
                                'Login failure, result: ' + result
                        #return false
                end
                
        end