Check if post request logged me in
Question: I am trying to log in with a post request using the python requests module on
a MediaWiki page:

    
    
    import requests
    
    s = requests.Session()
    s.auth = ('....', '....')
    url = '.....'
    values = {'wpName' : '....',
            'wpPassword' : '.....'}
    req = s.post(url, values)
    print(req.content)
    

I can't tell from the return value of the post request whether the login
attempt was succesful. Is there something I can do to check this? Thanks.


Answer: Typically such an authentication mechanism is implemented using HTTP cookies.
You might be able to check for the existence of a session cookie after you've
authenticated successfully. You find the cookie in the HTTP response header or
the sessions cookie attribute `s.cookies`.

