[eluser]Waqas Ahmad[/eluser]
Hi all,
it's my first post here. Can anybody guide me about following problem:
I have created a session in a controller using CI session, and then called it in an other controller where I printed the value of session. It is not working for any browser like IE7, Safari, Crome. But surprisingly it is working perfect in Firefox.
Notice:
1) I have tested the code on 2 different servers, both have PHP 5. On server 1, it is working perfect in all browsers, whereas it is not working on server 2.
2) PHP regular session is working on both of the servers, problem seems to be with CI session.
Can you tell me if it is some server configuration issue? or it is on CI end?
Following is the code which I am using to create the session and to display the session value.
Session Creator:
Code:
class Test extends Controller {
function Test()
{
parent::Controller();
$this->load->library('session');
}
function index()
{
$this->session->sess_destroy();
$this->session->sess_create();
$this->session->set_userdata(array('user_logged_in' => true));
echo("Session Created :: ".$this->session->userdata('user_logged_in'));
}
}
Session Display:
Code:
class Test2 extends Controller {
function Test2()
{
parent::Controller();
$this->load->library('session');
}
function index()
{
var_dump($this->session->userdata('user_logged_in'));
}
}
Thanks in advance :coolsmile:
Waqas