Working on a log in script to my webpage

Pete..... helten0007 at
Wed Mar 9 15:44:22 CET 2005


But I would really like to do this from scratch, so that I can learn it, I 
dont think I need that much more, before it works.

I found an example with asp, where the save the session if the password is 
correct. It isnt that long a code, so was wondering if it isnt possible to 
make something like that in python. Cause when this code is applied to the 
loginform, CODE2 will only have to be applied to every following page and 
everything is good.

code is from:
Set objRS = objConn.Execute (strSQL)
      '// see if there are any records returned
      If objRS.EOF Then
          'no username found
          strError = "- Invalid username or password<br>" & vbNewLine
          'check password
          If objRS("password")=Request.Form("password") Then
               'username/password valid
               'save session data
               Session("loggedin") = True
               Session("userid") = objRS("id")
               'redirect to members area
               Response.Redirect ("default.asp")
               'invalid password
               strError = "- Invalid username or password<br>" & vbNewLine

If Session("loggedin") <> True Then Response.Redirect "login.asp"
<title>Members Area</title>
<h1>Members Area</h1>
<p>Welcome to our members area!</p></body>
</html> In my code I have allready tested if the username and password is 
correct, so I just need to do the cookie thing :D

Thanks all, hope all my questions dosnt make you tired, I just really wanna 
figure this out, and I am doing this as a little hobby of mine, so I dont 
have anyone else to ask, hope that is okay...

"Kent Johnson" <kent37 at> wrote in message 
news:422ef991_1 at
> Pete..... wrote:
>> Hi all I am working on a log in script for my webpage.
>> I have the username and the password stored in a PostgreSQL database.
> You might want to look at Snakelets and CherryPy.
> Snakelets is "a very simple-to-use Python web application server." One of 
> the features is "Easy user authentication and user login handling."
> CherryPy is "a pythonic, object-oriented web development framework" that 
> seems to be popular. A recipe for password-protected pages in CherryPy is 
> here:
> Kent 

More information about the Python-list mailing list