PHP session empty

不想你离开。 提交于 2019-11-28 02:26:30

According to the php documentation: session_start

session_start() creates a session or resumes the current one based on a session identifier passed via a GET or POST request, or passed via a cookie.

So add session_start() to the top of your checklogin.php page.

Just use <?php session_start() ?> on top of page.

Configure your php.ini like this:

session.auto_start = 1;

Or run following command at your first line:

ini_set('session.auto_start', 1);
yasirfarooqui

Apart from using session_start(), there can be a couple of other reasons as well:

  1. Disk space is full on your server. This once happened to be the case with me. Try checking the available space on your server at root '/' (df -h).
  2. The sessions directory on your server (where the session files are being written) has some permission issues.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!