Welcome Guest, Not a member yet? Register   Sign In
CI session strange problem
#1

[eluser]Unknown[/eluser]
First of all, I'm using Codeigniter more than 3 years. But get this problem only now with new version of CI and while testing my project in Internet Explorer (firefox, chrome works well).

I've made library for easy integration with some social services, I autoloaded SESSION and my library have this code:
Code:
$IND->session->set_userdata('key', $key);
$IND->session->set_userdata('user_id', $user_id);

When I navigating application and one of my controllers try to get session variables ....for example:

Code:
$auth = $this->session->userdata('key');
$user_id = $this->session->userdata('user_id');


and call the function with this variables:

Code:
$this->my_lib->check_auth($user_id, $auth);

I got error, because userdata variable missing.

When I open session database and looking on it, I see this duplicate MSIE entry:

Code:
2cb9697af53d3d9b5280cc9bf2ba143d  xxx.xxx.xxx.xxx  Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2...  1380040484  a:3:{s:9:"user_data";s:0:"";s:8:"auth_key";s:32:"0........... etc

6130a0f9fe747d1be176f943585450a2  xxx.xxx.xxx.xxx  Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2...  1380040485


When I started with firefox session, database have only 1 entry and my application works fine.

Please, help.

PS: Any of the Config cookies settings don't solve my problem.

#2

[eluser]Unknown[/eluser]
I successfully solved the problem. Thanks anyway.

Simple, put somewhere in your PHP code this line:

Code:
header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');

This helps to process session cookies in your application via IE




Theme © iAndrew 2016 - Forum software by © MyBB