Codeigniter flashdata not working in internet explorer and google chrome

不问归期 提交于 2019-12-02 11:39:36

问题


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.


回答1:


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.




回答2:


I was able to solve the problem by setting:

$config['sess_use_database']= FALSE;
$config['sess_cookie_name']= 'cisession';
$config['sess_expiration'] = 84200;


来源:https://stackoverflow.com/questions/13184304/codeigniter-flashdata-not-working-in-internet-explorer-and-google-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!