会话未设置? [英] Session not being set?

查看:130
本文介绍了会话未设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个登录系统的网站。它对我很好。当我登录 session-> userdata('admin_logged_in')设置为true ..我的同事正试图登录到网站,但会话isnt组。它最初设置,但是当他更改页面时,会话被清除。

I have a website with a login system. It works fine for me. When I log in the session->userdata('admin_logged_in') gets set to true.. My co-worker is trying to log in to the site but the session isnt set. It gets set initially but when he changes pages, the sessions are cleared.

我们尝试向网站添加自己的会话,当网页更改时,他们已清除。我们尝试了不同的网站和会话did not保存在那里。

We tried adding our own sessions to the site, they got cleared when the page changed. we tried different sites and the sessions didnt save there either.

所以我的问题是,有没有人知道为什么他的电脑,一个asus笔记本电脑,不允许会话保存。

So my question is, does anyone know why his computer, an asus laptop, wouldnt allow sessions to be saved.

如何工作。

 if($this->session->userdata('admin_logged_in')) {
      redirect('/manager/');
 }

在经理功能中,

 if (!$this->session->userdata('admin_logged_in')) {
      redirect('/auth/');
 }

每次都将我的同事重定向到auth。

It redirects for my co worker to "auth" every time. It works fine for me.

我们尝试了

 var_dump($this->session->userdata('admin_logged_in'))

推荐答案

而不是echoadmin ... a debug:

Instead of echo "admin ..." you should do a debug:

var_dump($this->session->userdata('admin_logged_in'));

来查找变量/对象中的内容。因此您可以重新设计问题的原因。

to find out whats in the variable/object. so you can re-engineer to the cause of the problem.

这篇关于会话未设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆