Jump to content


Photo

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

pear authentication sessions

  • Please log in to reply
No replies to this topic

#1 davidannis

davidannis

    Freak Dr.

  • Members
  • PipPipPip
  • 588 posts
  • LocationOkemos, MI USA

Posted 02 March 2013 - 09:37 AM

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?

 

Thanks,

David






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com