php - 从外部文件访问 codeigniter session 值

标签 php session codeigniter

在我的 codeigniter 项目中,我添加了 KCK finder。

它需要一些由 codeigniter 控制的 session 值。 我如何从外部文件访问 CI session 值?

最佳答案

<?php
    ob_start();
    include('index.php');
    ob_end_clean();
    $CI =& get_instance();
    $CI->load->library('session'); //if it's not autoloaded in your CI setup
    echo $CI->session->userdata('name');
?>

关于php - 从外部文件访问 codeigniter session 值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7926455/

相关文章:

javascript - Php magento SESSION 变量在 php 内执行 javascript 代码之前未设置

bash - shell 终端 session 中环境之间的共同点是什么?

php - codeigniter INSERT 仅插入变量名称

php - 如何通过 PHP SDK 使用访问 token 并使用 fql 检索 user_activities 参数?

php - 条件类 drupal 7 和 IE9

reactjs - 如何从reactjs中的所有组件访问登录详细信息

javascript - Ajax 帖子不工作 codeigniter

javascript - AJAX响应返回html内容

php - 强制 wordpress 通过 TCP 连接到数据库

php - ZF : Disable Resource Plugin in application. ini