Welcome Guest, Not a member yet? Register   Sign In
Loginsystem with sessions.
#2

[eluser]Colin Williams[/eluser]
Well, you should probably create or use a more robust library to handle such systems. I would recommend doing more than simply checking for the existence of a session variable. CodeIgniter includes a Session library, and there are several improvements in the Wiki to consider using as a base for your login system. The user library I use has an access method that lets you easily perform these types of checks:

Code:
if ($this->user->access())
{
  // Do something for any logged in user
}
if ($this->user->access('modify content'))
{
  // Do something for any user with 'modify content' permission
}
if ($this->user->access(NULL, 'user/login'))
{
  // Do something for any logged in user, redirect to 'user/login' otherwise
}

As you can see, the method reads well and provides multiple uses to streamline code. I'd suggest trying something similar.


Messages In This Thread
Loginsystem with sessions. - by El Forum - 06-23-2008, 11:13 AM
Loginsystem with sessions. - by El Forum - 06-23-2008, 01:02 PM
Loginsystem with sessions. - by El Forum - 06-23-2008, 01:13 PM
Loginsystem with sessions. - by El Forum - 06-23-2008, 01:25 PM
Loginsystem with sessions. - by El Forum - 06-23-2008, 01:43 PM



Theme © iAndrew 2016 - Forum software by © MyBB