9

Forgive me if this has already been asked (and feel free to provide a reference and close this).

The ultimate goal is to associate some data with each user (obviously) and display that data to users differently based on their roles.

I have looked extensively for a simple, drop-in solution for authenticating users in PHP.

I am not looking for:

  • A CMS with authentication
  • A PHP MVC Framework

This project is too simple for both, and while it should go to production eventually, will be performed by novice programmers. I want to be teaching them PHP, not specifics for a CMS or a framework. I am not completely opposed to the idea of a framework, but all the frameworks I have looked at enforce MVC and that is too advanced a concept at this point.

I am looking for something that will allow me to easily register users, login users, and put users into roles. Ideally, this means having a library that will handle the database & encryption logic and provide me with a simple API to do the above. I prefer to provide the library with a database and let it do its thing without any interaction from me - storing data in the session is also preferable but not required.

I know I could easily do this myself, but I want to make things simple for those I am teaching. A library/component/etc is what I want for this. I've been all over PEAR, and the modules there seem overly complicated. The two authentication providers given in the PHP5 documentation seem unclear to me. Examples of those in action, if they do what I've described, would work. Any ideas?

1
  • You may want to take a look at github.com/delight-im/PHP-Auth which is both framework-agnostic and database-agnostic. Commented Sep 22, 2016 at 3:40

1 Answer 1

4

Login Sessions

It's a little out-dated, but still comes with great concepts.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.