Codeigniter session doesn't work?

陌路散爱 提交于 2020-01-06 08:57:13

问题


I have a website based on Codeigniter which works fine. I had to clone this site with database to an another host. I copied the database and all files. My problem is: the session doesn't work on the new site. (I recognized it at the login). The same code works on the old host, but everything is exactly the same. Does somebody have any idea? Is it a codeigniter configuration issue? Thanks


回答1:


Check your application/config.php especially these lines:

$config['cookie_prefix']    = "";
$config['cookie_domain']    = "";
$config['cookie_path']  = "/";
$config['cookie_secure']    = FALSE;

Also: please delete your cookie-history (if you're using Firefox: CTRL-SHIFT-DELETE)

Alternatively you could use (shameless self-plug) codeigniter-native-session I too had a bit to much problems with the built-in session engine. It basically mimics the Codeigniter session class so just drop in these files into your application folder and code doesn't needs any modification. (and you'll be using PHP-native-sessions)

Hope it helps.



来源:https://stackoverflow.com/questions/12039454/codeigniter-session-doesnt-work

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