douxuanou2787 2018-11-06 11:52
浏览 264
已采纳

在session.save_path Codeigniter中使用模式格式

I'm facing a problem using the session library in Codeigniter. On this page it specifically says

To be more specific, it doesn’t support PHP’s directory level and mode formats used in session.save_path, and it has most of the options hard-coded for safety. Instead, only absolute paths are supported for $config['sess_save_path'].

Now what I want is to create session files with permissions 777. I've set the session_save_path in php.ini to 0;0777;/home/sessions/. This is overwritten by the local value by Codeigniter to /home/sessions. How can I force Codeigniter to create these session files with 777 permissions, as it doesn't support this in the config file.

Please don't mind about the 777 permissions on session files.

  • 写回答

2条回答 默认 最新

  • doulouli8686 2018-11-08 14:35
    关注

    About changing the default dir permissions which ic 0700 by default, i don't recommend this at all cause you'll have to change the core system files which is a very bad practice but if you must have a look at Session_files_driver.php and change mkdir($save_path, 0700, TRUE) to mkdir($save_path, 0777, TRUE) if you must and if it doesn't exist already with 0777 permission... btw, i think its way better to use db to store sessions.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 beats蓝牙耳机怎么查看日志
  • ¥15 Fluent齿轮搅油
  • ¥15 八爪鱼爬数据为什么自己停了
  • ¥15 交替优化波束形成和ris反射角使保密速率最大化
  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏