Jump to content

What does PEAR Auth do that session_start() does not?


Recommended Posts

I have coded a couple of applications and for logging in users, I do the following:

  1. ask the user for a username
  2. create a password
  3. salt and encrypt the password
  4. store the username and encrypted password in a database
  5. e-mail the user his password
  6. on a login page, ask the user for his username/password pair
  7. salt and encrypt the password provided by the user
  8. compare the encrypted password value to the one stored in my database
  9. if the encrypted value matches I do a session_start() and store the user_id in a session variable.
  10. on every page I do session_start() and check the session variable for the user_id
  11. if the user_id is not found redirect to the login page if it is give them access to whatever they should have access to.

Now, I have inheritted a program that I did not write and it handles authentication using the PEAR:Auth module. I had a user complain that he was being repeatedly redirected tot he login page. I could not replicate his problem and closing and re-opening his browser solved the problem on his end, but I'm assuming he's not insane so I am tempted to rip out the existing PEAR:Auth methodology of tracking users and replace it with what I am used to. However, PEAR:Auth must do more than php sessions or nobody would use it so I worry that if I replace it I will eaither be making things less secure or losing some functionality. Try as I might, I can't see what I'd lose by replacing PEAR with something simpler. What am I missing? What does PEAR:Auth give me that php sessions doesn't?




Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.