Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 无法从tank auth codeigniter中的会话获取用户id_Php_Codeigniter - Fatal编程技术网

Php 无法从tank auth codeigniter中的会话获取用户id

Php 无法从tank auth codeigniter中的会话获取用户id,php,codeigniter,Php,Codeigniter,我有控制器 <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); error_reporting(E_ALL); ini_set('display_errors', 1); class Response extends CI_Controller { function __construct() { parent::__construct(); $th

我有控制器

<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
error_reporting(E_ALL);
ini_set('display_errors', 1);
class Response extends CI_Controller
{
    function __construct()
    {
        parent::__construct();
        $this->load->library('tank_auth');

    }

    function index()
    {
        $status = $this->input->post('status');
        $data['amount'] = $this->input->post('amount');
        $data['orderID'] = $this->input->post('orderID');
        $data['mobileNo'] = $this->input->post('mobileNo');
        $data['email'] = $this->input->post('email');
            echo "userid is".$this->tank_auth->get_user_id();
    }
 }

确保会话已设置。会话已设置。im在其他控制器中使用相同的会话。其工作方式是否有任何错误?试试这个
echo($this->tank\u auth->is\u logged\u in()?$this->tank\u auth->get\u user\u id():“无会话”)我没有得到任何会话作为输出。会有什么问题?是的,我登录了。它在其他控制器中工作正常