Create a blank session for guests, is this normal?

When users are authenticated, logged in session ID, group, link, avatar, etc.

But I noticed that the guests also generated the session files, but empty (0кб). is this normal?

If not fixed, will there be bad?
March 12th 20 at 08:00
2 answers
March 12th 20 at 08:02
Highly dependent on site traffic and session storage. In the case that sessions are stored for a long time, and all in the form of a file - perhaps a quick clogging of inodes. You need to pay attention to the parameter session.gc_maxlifetime in php.ini.
How good practice not to do, session_start, if the user is not logged in (no cookies) and \ or trying to log in (empty request)? This technique would solve the problem of the author. - Aletha_Conroy commented on March 12th 20 at 08:05
@Aletha_Conroy, it is normal practice, but not always this is possible (in the session may drop localization, for example) - in this case, there is the option of storing the contents of the session directly in a cookie (encrypted). - Jadon_Koss commented on March 12th 20 at 08:08
March 12th 20 at 08:04
Only if you did the php settings and garbage collection have stopped working.
Have in mind that the old / unnecessary files are not deleted.
in the future, you may need to Google "php session files are not deleted"

Find more questions by tags PHP