user623990
user623990

Reputation:

How to manage sessions and users with CodeIgniter?

I'm in the middle of moving my site into the CodeIgniter framework. I've never used a MVC framework before so this is a big step.

In my old site, each page would have include("session_handler.php"); at the top of each page. This script would check session variables, authenticate sessions and store stuff in the database.

Is there a way I can have this script automatically include in every page? Can I specify it in the config? Does CI maybe have an internal way of dealing with sessions that is superior to my method?

Upvotes: 0

Views: 1551

Answers (1)

Ben
Ben

Reputation: 21249

Code Igniter has a Session class you can use.

It also has an autoload functionality.

Those two things should cover your requirements I think...

If you need additional validation to the session, you can either extend the core session class (which may be asking too much if you're only starting on the framework) or you can create your own library and auto-load it right after the session one to run some additional code..

Upvotes: 2

Related Questions