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

I have a login script to acces my CMS with the help of ci_sessions
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'))))
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:

class start extends Controller {

    function start()
        if(!$this->user_model->Secure(array('userType' => 'user')))
            $this->session->set_flashdata('flashError', 'This is not a admin account');
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


I typed this in a hurry, appologies for the typo's
basicly my website inserts 8 records in my ci_session table before I even try to login.
It even adds the flash error(no idea if that suppose to happen).
I never edit this coude or anything so I really have no clue whats going on...:S

PS: it does work local...localhost

The sessions are not sticking between your computer and your website, so CI is assuming it's a new visitor on every page load, and creates a new session.

It's likely a cookie issue. Adjust your config.php file's cookie settings to make sure that the domain, path, etc all match properly.

I am going to guess you are using Internet Explorer as well, which can cause issues. Like Aken mentioned double check your /application/config/config.php for your cookie settings. I would suggest setting
$config['sess_match_useragent'] = FALSE;

OMG thanks it was the:
$config['sess_match_useragent']    = FALSE
Why does this cause a problem all of a sudden?
it never did before:S...

Sometimes it just the behavior of IE. Because of compatibility mode, IE may send different user agents to the server.

Theme © iAndrew 2016 - Forum software by © MyBB