Welcome Guest, Not a member yet? Register   Sign In
ci_sessions not cooperating!![SOLVED]
#1

[eluser]Ivar89[/eluser]
I have a login script to acces my CMS with the help of ci_sessions
Code:
function login()
        {
                $this->form_validation->set_rules('userName', 'Username', 'trim|required|callback_check_login');
                $this->form_validation->set_rules('userPassword', 'Password', 'trim|required');

                if ($this->form_validation->run())
                {
                    if($user = $this->user_model->Login(array('userName' => $this->input->post('userName'), 'userPassword' => $this->input->post('userPassword'))))
                    {
                        redirect('start/index');
                    }else{
                    redirect('login');
                    }
                }
            $this->load->view('admin/login_form');
        }
This works(as far as I kow)
now to get in my CMS it suppose to take you to: start/index but this does not happen!
I AM using te correct login and password(checkd that) else it would give me errors.
It goes wrong here:
Code:
<?php

class start extends Controller {

    function start()
    {
    
    parent::controller();
        $this->load->model('main_model');
        if(!$this->user_model->Secure(array('userType' => 'user')))
        {
            $this->session->set_flashdata('flashError', 'This is not a admin account');
            redirect('admin');
        }
    
    }
it checks the userType here, and it keeps saying it is NOT an admin type(but it is! it also says so in the userdata(of ci_session table)but in the same table it give the flash error for some reason...
then I checked further and when I visite the lgin page it already makes 8 records in the ci_session table:S and normally that doesn't happen...
Now I use the same one with all my other logins I made and never had this before:S
if anyone knows what it is please help meSmile

thanks


Messages In This Thread
ci_sessions not cooperating!![SOLVED] - by El Forum - 08-02-2011, 07:37 AM
ci_sessions not cooperating!![SOLVED] - by El Forum - 08-02-2011, 07:46 AM
ci_sessions not cooperating!![SOLVED] - by El Forum - 08-02-2011, 03:38 PM
ci_sessions not cooperating!![SOLVED] - by El Forum - 08-02-2011, 09:14 PM
ci_sessions not cooperating!![SOLVED] - by El Forum - 08-03-2011, 01:20 AM
ci_sessions not cooperating!![SOLVED] - by El Forum - 08-03-2011, 06:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB