Welcome Guest, Not a member yet? Register   Sign In
Sessions - Bug?
#17

[eluser]Fierymind[/eluser]
well, the "sommtimes" failure drive me crazy, but here is some info in my case, may that help:

- we do try this on live web server with live domain name
- there is NO output before cookie/session work and I know what I'm talking about.

here is the user/password verification function

Code:
function verifyUser($u,$pw){
        
        $this->db->where('user_name',$u);
        $this->db->where('user_pass', md5($pw));
        $Q = $this->db->get('users');

        if ($Q->num_rows() > 0){
            $row = $Q->row_array();
            $something = $this->session->set_userdata('user_id',$row['user_id']);
            $this->session->set_userdata('user_name',$row['user_name']);
            $this->session->set_userdata('access_level',$row['access_level']);
            return TRUE;
        }else{
            
            return FALSE;
        }        
    }

if we put this function in model 'muser', and called it from 'user' controller like :

Code:
if (!$this->muser->verifyUser($_POST['username'],$_POST['password']))
{ /*you are not loged */ } else {/* you loged*/}

it will "sometimes" fail to write the cookie

but if I put the same function in controller 'user' itself and called it like

Code:
if (!$this->verifyUser($_POST['username'],$_POST['password']))
{ /*you are not loged */ } else {/* you loged*/}

it works allllll the time.

please note that session lib and all models are autoloaded.


Messages In This Thread
Sessions - Bug? - by El Forum - 01-01-2009, 04:09 PM
Sessions - Bug? - by El Forum - 01-01-2009, 04:40 PM
Sessions - Bug? - by El Forum - 01-01-2009, 06:07 PM
Sessions - Bug? - by El Forum - 01-02-2009, 12:42 AM
Sessions - Bug? - by El Forum - 01-02-2009, 04:50 AM
Sessions - Bug? - by El Forum - 01-02-2009, 10:17 AM
Sessions - Bug? - by El Forum - 01-02-2009, 10:32 AM
Sessions - Bug? - by El Forum - 01-02-2009, 01:51 PM
Sessions - Bug? - by El Forum - 01-15-2009, 06:58 PM
Sessions - Bug? - by El Forum - 01-16-2009, 12:09 AM
Sessions - Bug? - by El Forum - 01-16-2009, 09:23 AM
Sessions - Bug? - by El Forum - 01-16-2009, 10:04 AM
Sessions - Bug? - by El Forum - 01-16-2009, 10:17 AM
Sessions - Bug? - by El Forum - 01-16-2009, 10:47 AM
Sessions - Bug? - by El Forum - 02-01-2009, 07:03 AM
Sessions - Bug? - by El Forum - 02-01-2009, 07:13 AM
Sessions - Bug? - by El Forum - 02-01-2009, 07:45 AM
Sessions - Bug? - by El Forum - 02-01-2009, 08:43 AM
Sessions - Bug? - by El Forum - 02-01-2009, 11:32 AM
Sessions - Bug? - by El Forum - 02-01-2009, 12:09 PM
Sessions - Bug? - by El Forum - 02-01-2009, 12:17 PM
Sessions - Bug? - by El Forum - 02-01-2009, 12:34 PM
Sessions - Bug? - by El Forum - 02-01-2009, 04:10 PM
Sessions - Bug? - by El Forum - 02-01-2009, 04:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB