dqjcb132285 2011-08-18 08:36
浏览 66

如何在具有多个数据库的CodeIgniter中存储数据库会话?

I am using codeigniter and till date I was using cookie based sessions.. but now size of sessions is increased so i need to store them in database..

I have multiple database(more than 3) connected to my application..How can i specifically use ci_sessions table to store sessions?

when i say $config['sess_use_database'] = TRUE; my app goes blank. a plane white page is shown.

That is because From multiple database connections codeigniter is not finding exact database to store sessions..

How can i achieve the same? Thanks

  • 写回答

2条回答 默认 最新

  • duanlachu7344 2011-08-18 08:58
    关注

    Looking at the session code from system/libraries/Session.php, one can see that it uses the default $this->db to connect to the database for storing sessions.

    Try modifying your database groups such that $this->db works. Alternatively, you can extend the Session.php such that you can pass it the database group for storing sessions.

    Hope this gets you started in the right direction.

    评论

报告相同问题?

悬赏问题

  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程