Welcome Guest, Not a member yet? Register   Sign In
CodeIgniters session library - how to?
#1

[eluser]v33s[/eluser]
Hello all,
I am new in CodeIgniter and I have a question about CodeIgniters Sessions. Can someone explain me how to start write simple admin login page area? I tried most of complete Authorization Systems but I don`t understand how to implement them in my code.

Ok. I have my `admins` MySQL table with -id-name-md5password- columns.

On first place in my Contructor, i have that code:
Code:
$this->load->library(array('session', 'validation'));

I would like to check the form values with the database values, if it is correct then make a session.

I can extract user from database, but how to make a session, check it if admin is now logged in???

I found in User Guide how to make a session:

Code:
$newdata = array(
                   'username'  => 'johndoe',
                   'email'     => '[email protected]',
                   'logged_in' => TRUE
               );

$this->session->set_userdata($newdata);

And now, what I must change in this array? Replace username with this from database?
How to check this session if it is correct?

Sorry for my English Wink


Messages In This Thread
CodeIgniters session library - how to? - by El Forum - 04-13-2008, 04:30 AM
CodeIgniters session library - how to? - by El Forum - 04-13-2008, 07:54 AM
CodeIgniters session library - how to? - by El Forum - 04-13-2008, 08:40 AM
CodeIgniters session library - how to? - by El Forum - 04-13-2008, 08:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB