douyanpeng0748 2016-03-03 22:56
浏览 25
已采纳

在我的Codeigniter项目上维护会话

I am having two domain urls for my online store:

example1.com for admin,

and example2.com for front end.

My CI project on both the URLs access the same database.

So, the problem now is when I stay in the admin side, everything works fine. But if I visit the front end site once and then come back to admin url and reload, then my session is destroyed and I have to login again.

If any one can explain me why the session is being destroyed.

So, I want a solution here to access the same database in different urls in codeigniter with out destroying the session.

  • 写回答

1条回答 默认 最新

  • doukai1226 2016-03-03 23:33
    关注

    In the CI application config file, make 'sess_use_database' to true, so that session will store in database, which makes session intact on different domains.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部