skip to Main Content

From time to time I get the classic "Failed to read session data" error on my application running on php 8, IIS 2019. This is usually associated with a) the directory does not exist b) the permissions are not set. I can rule out both cases.

Sessions are stored in c:/Temp/phpsessions. All read/write permissions are set correctly. Most of the times there is no problem. But if users doesn’t log in for a while I get the following warning and the app does not work.

PHP Warning: session_start():open(C:tempphpsessionssess_221kd8pv25fvefq@tnph9fhoss,O_RDWR)failed:Permission denied(13)...

Again, the session_path is set in php.ini, most of the time everything works. I thought maybe the session key does not have a corresponding session file anymore. But that should not generate an error but a new session. What am I missing?

I tried to store Session Variables and start the session with session_start(). I expect an old session to be invalid and not cause a permission denied warning. I expect a new empty session to be created.

2

Answers


  1. Chosen as BEST ANSWER

    We had problems with permissions of authenticated users. The temp folder should have been accessible to everyone, but it seems the folder was deleted and created again with different permissions. The mysteries of working with computers …


  2. The "Failed to read session data" error can occur for a number of reasons, it may be caused by a misconfiguration of the PHP process. Check the session_handler parameter in the PHP process handler. For more information, please refer this document. Hope this idea helps you.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search