Re: login website that using PHP



The behaviour with the browser is what is known as a 'session cookie'
-the site sets it when you login and the browser keeps it until you end
the session by closing the browser.

You handle the cookie using ClientCookie (Python 2.3) or cookielib
(Python 2.4). You need to create a cookiejar instance and an opener
that uses HTTPCookieProcessor (and your cookiejar).

When you've done that - calls to your opener will fetch pages and
handle the cookie *compeltely automatically*.

There is an example of doing that at
http://www.voidspace.org.uk/python/articles.shtml#http


The authentication is via an html form. You can handle this using
ClientForm - or you can look at the HTML source of the page and just
have your opener (as above) send the right values to the URL. If you
have problems - post the details here and people will help.

It is *possible* that the javascript does 'magic' on the form
submission (client side encryption is one possibility). That is very
hard to automatically duplicate from Python because you would need to
parse the python and mimic the page DOM to duplicate the effect. It
might be easier to use PAMIE to automate the form submission in the
browser. I've never tried this myself - but seen the announcements
here.

Best Regards,

Fuzzy
http://www.voidspace.org.uk/python
unfortunately voidspace is temporarily down :-(

.



Relevant Pages

  • Re: ADFS Token Auth clarification
    ... cookie is a session cookie, ... Session cookies are shared across a browser process. ... Windows opened by that process. ...
    (microsoft.public.windows.server.active_directory)
  • Re: Attempt to de-mystify AJAX
    ... "Hyperlinks" always open a new browser window. ... key (cookie) is still there and still contains the original value. ... You can get the cookies from the HTTP_COOKIE CGI environment variable. ...
    (comp.databases.pick)
  • Re: NSA Used Cookies to Track Visitors Web Activities?
    ... Could unwittingly installing a compromised browser open the doors wide to cookie-based intrusions? ... A cookie itself is unlikely to be a virus, but if the browser code is written in C, it is very likely to have arrays that are susceptible to "buffer overrun" Sometimes a clever enough person can use such a bug to cause executable code stored in an allegedly non-executable file to replace code in your browser or operating system. ... an external intruder coming in over an Internet connection, presumably that intruder would have access to the cookies on one's machine. ...
    (comp.sys.mac.system)
  • Re: session riding
    ... > When a user browses my script I'd like to grab a session cookie from the ... A normal browser will only send you cookies in the same ... domain as the request, so this is likely not possible. ...
    (comp.lang.ruby)
  • Re: Cookies from ASP.NET app not persisting even when enabled!
    ... > I'm new to ASP.NET and have been developing a small app at work to test ... > and the authorization cookie is saved as expected on the local machine. ... any browser OTHER THAN the one on the development ...
    (microsoft.public.dotnet.framework.aspnet)