tags:

views:

80

answers:

4

I have never really done any serious web programming, other than just a blog or a static web page. For a web application I am developing though, I need to have web site logins.

In an attempt to not reinvent the wheel, how can I implement logins? Is there a "drop-in" component somewhere? I'm not averse to fooling around with cryptography, but I don't really have much experience using PHP or web protocols.

EDIT: I am using the CodeIgniter framework, so if anyone has any answers in that context, I'd be interested.

A: 

There are a lot of different ways to do it depending on use of cookies/database/etc. I have used this php login system before with some luck. The great thing about what you will find is that you can mix and match depending on what you're trying to do. The system I referred also has administration/user levels for varying levels of access. You will find a good tutorial on rolling your own here.

I would suggest reading up using password salts, PHP cookies, and sessions if this is going to be world visible.

manyxcxi
A: 

There are many solutions for user logins, but all the solutions I know are part of a CMS, or a framework like Zend.

kiamlaluno
+3  A: 

Allow me to recommend OpenID to you. Instead of implementing your own authentication scheme, you delegate authentication to an account provider that your user already has (such as Google, FaceBook, LiveJournal, etc.)

Libraries that implement OpenID on PHP for you include:

Craig Trader
I think this definitely fits in the "mature" category, but it's pretty deep and can get messy if you have to start mixing authentication types and providers. If you're expecting a small demographic of non-tech-savvy users, ut;s probably best to go for something simpler
scrumpyjack
A year ago, I would have written my own auth package (and did) based on sessions. Today, though, I'd go with OpenID. Many mainstream sites are using Facebook/Twitter/MS/Google authentication these days. I think it's easier for users than creating an account with you.
Alex JL
+2  A: 

I'd recommend a nice authentication library for CI:Tank Auth.

SpawnCxy