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():“无会话”)代码>我没有得到任何会话作为输出。会有什么问题?是的,我登录了。它在其他控制器中工作正常