doupoji3856 2016-12-23 12:29 采纳率: 100%
浏览 32

如何通过admin删除codeigniter中的用户会话?

I want to unset the user session by admin. As I have tried all my tricks but Can't find any way!

I want to remove a user session by clicking on anchor tag which has id of the user.

<a class="pull-right" href="<?= base_url("admin/unset_emp_session/$id")?>">Distroy Session</a>

$id=5;

I used this to unset the session of user so that the user panel will get stop and come back on login page as session has been destroyed by admin.

However, In the user login Controller I have created a session of user by name and id.

$this->session->set_userdata('employee_id', $user_data['id']);
$this->session->set_userdata('employee_name', $user_data['firstname']);

Now, I have unset them in the admin control. How can I do this? Any help will be appreciated.

  • 写回答

3条回答 默认 最新

  • dora0817 2016-12-23 12:36
    关注

    You can try this to unset your session varaible in Codeigniter :

    $this->session->unset_userdata('employee_id');
    $this->session->unset_userdata('employee_name');
    
    评论

报告相同问题?

悬赏问题

  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
  • ¥15 路易威登官网 里边的参数逆向
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
  • ¥50 需求一个up主付费课程
  • ¥20 模型在y分布之外的数据上预测能力不好如何解决
  • ¥15 processing提取音乐节奏
  • ¥15 gg加速器加速游戏时,提示不是x86架构
  • ¥15 python按要求编写程序
  • ¥15 Python输入字符串转化为列表排序具体见图,严格按照输入
  • ¥20 XP系统在重新启动后进不去桌面,一直黑屏。