session_start() creates new session every refresh [duplicate]

不羁岁月 提交于 2019-11-28 01:58:58

If your session directory (most like /tmp as you said) is not writable, then it won't be able to save and will have to regenerate a new one each time. Here is how you can verify it:

if ( !is_writable(session_save_path()) ) {
   echo 'Session save path "'.session_save_path().'" is not writable!'; 
}

If that is the case, you will need to have the server admins give what ever user your webserver runs as permission to write to the /tmp directory.

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