1

Codeigniter flashdata not working in internet explorer and chrome but it is working on firefox.What could be the issue?.

In My controller:-

$this->session->set_flashdata('login_error','Your username or password is incorrect.');
redirect(base_url().'admin/login');

In My view

echo  '<span>'.$this->session->flashdata('login_error').'</span>';

In Chrome and ie i'm getting blank span whereas in firefox it is displaying flash data.

There are similar questions on the stack but i could not find any answer which are working.

Sachin Prasad
  • 5,365
  • 12
  • 54
  • 101

2 Answers2

0

I solved my problem.There was some issue with ie and chrome cookie management.

I change the 'sess_cookie_name' in config from 'ci_session' to 'cisession'

and sess_expiration from 7200 to 84200 and it got fixed.

Sachin Prasad
  • 5,365
  • 12
  • 54
  • 101
  • Just to keep in mind, the flashdata works better with a `refresh` redirection instead of `location` – manix Nov 02 '12 at 15:58
0

I was able to solve the problem by setting:

$config['sess_use_database']= FALSE;
$config['sess_cookie_name']= 'cisession';
$config['sess_expiration'] = 84200;
Shannon Young
  • 1,536
  • 1
  • 17
  • 26