Welcome Guest, Not a member yet? Register   Sign In
Store id from user in session
#3

[eluser]sb05[/eluser]
This was originally in the Session.php.
Code:
function sess_create()
    {
        $sessid = '';
        while (strlen($sessid) < 32)
        {
            $sessid .= mt_rand(0, mt_getrandmax());
        }

        // To make the session ID even more secure we'll combine it with the user's IP
        $sessid .= $this->CI->input->ip_address();

        $this->userdata = array(
                            'session_id'     => md5(uniqid($sessid, TRUE)),
                            'ip_address'     => $this->CI->input->ip_address(),
                            'user_agent'     => substr($this->CI->input->user_agent(), 0, 50),
                            'last_activity'    => $this->now
                            );

Only thing i added where the lines:

Code:
if (isset($this->userdata['id'])) {
             $db_data['id'] = $this->userdata['id'];
         } else {
             $db_data['id'] = '';
             }

But it don't save the id of the user that is logging in.
I'm using the dx_auth library if that matters.

Tnx


Messages In This Thread
Store id from user in session - by El Forum - 01-20-2011, 07:55 AM
Store id from user in session - by El Forum - 01-20-2011, 08:31 AM
Store id from user in session - by El Forum - 01-20-2011, 09:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB