Codeigniter flashdata not working in internet expl

2019-02-28 12:14发布

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.

2条回答
迷人小祖宗
2楼-- · 2019-02-28 12:47

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.

查看更多
走好不送
3楼-- · 2019-02-28 12:58

I was able to solve the problem by setting:

$config['sess_use_database']= FALSE;
$config['sess_cookie_name']= 'cisession';
$config['sess_expiration'] = 84200;
查看更多
登录 后发表回答