Welcome Guest, Not a member yet? Register   Sign In
Can I access session->user_id using a post_controller_constructor hook?

I want to be able to get the user_id to use in a post_controller_constructor hook but I am getting an error
Quote:Message: Undefined property: CI_Session::$user_id

Here's my code
<?php defined('BASEPATH') OR exit('No direct script access allowed');

class CheckProfile {
private $CI;

public function __construct(){
  $this->CI =& get_instance();
function is_profile_complete(){
     if($this->CI->contractor_m->profile_check($this->CI->session->user_id) == TRUE){
   $this->CI->session->set_userdata('profile_complete', TRUE);
   $this->CI->session->set_userdata('profile_complete', TRUE);
  $this->CI->session->set_userdata('profile_test', "test worked");

Try loading the database, because the last thing CodeIgniter doe's is close any open database's

See the last line in ./system/core/codeigniter.php

Theme © iAndrew 2016 - Forum software by © MyBB