Title: Problem with Session
Last modified: August 10, 2023

---

# Problem with Session

 *  Resolved [WebCodePoet](https://wordpress.org/support/users/senjoralfonso/)
 * (@senjoralfonso)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/problem-with-session/)
 *     ```wp-block-code
       session_start(): Failed to read session data: redis (path: unix:///var/run/redis/redis.sock?persistent=1&amp;weight=1&amp;database=16) in /wp-content/plugins/ninjafirewall/lib/utils.php on line 130"
       ```
   
 * NinjaFirewall reads the & as an &amp; I do not know why.

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [nintechnet](https://wordpress.org/support/users/nintechnet/)
 * (@nintechnet)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/problem-with-session/#post-16965090)
 * On line 130 of the ninjafirewall/lib/utils.php script, there’s just a call to
   the PHP session_start() start:
 *     ```wp-block-code
       128   if ( session_status() !== PHP_SESSION_ACTIVE ) {
       129      nfw_ini_set_cookie();
       130      session_start();
       131   }
       ```
   
 * Could this be due to a misconfiguration in your PHP INI file?
 *  Thread Starter [WebCodePoet](https://wordpress.org/support/users/senjoralfonso/)
 * (@senjoralfonso)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/problem-with-session/#post-16966874)
 * Hey, I think that my INI is correct, here are the credentials:
 * session.save_handler = redis
   session.save_path = “unix:///var/run/redis/redis.
   sock?persistent=1&weight=1&database=16”redis.session.locking_enabled = 1redis.
   session.lock_expire = 300redis.session.lock_wait_time = 50000redis.session.lock_retries
   = 2000session.use_strict_mode = 0session.use_cookies = 1session.use_only_cookies
   = 1session.name = PHPSESSIDsession.auto_start = 0session.cookie_lifetime = 0session.
   cookie_path = /
 *  Plugin Author [nintechnet](https://wordpress.org/support/users/nintechnet/)
 * (@nintechnet)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/problem-with-session/#post-16968839)
 * The path looks fine. The `&amp;`  character comes from PHP when it throws the
   error.
   Try to run the following script:
 *     ```wp-block-code
       <?phpif ( session_status() !== PHP_SESSION_ACTIVE ) {echo "Starting a session.";session_start();exit;}echo "A session is already active.";
       ```
   
 * Save that to a “sessiontest.php” file, upload it in your WordPress root folder
   and visit [https://your-site/sessiontest.php](https://your-site/sessiontest.php)
   to see if it works or returns the same error.
   Don’t forget to disable the firewall
   before running the script.
 *  Thread Starter [WebCodePoet](https://wordpress.org/support/users/senjoralfonso/)
 * (@senjoralfonso)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/problem-with-session/#post-16969470)
 * Hey, the output is ‘Starting a session’. Independent of the state of the firewall
   or if I am logged in or not.
 *  Plugin Author [nintechnet](https://wordpress.org/support/users/nintechnet/)
 * (@nintechnet)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/problem-with-session/#post-16970397)
 * It seems to be working as expected.
   Do you see the error in your PHP log every
   time you access the site or randomly?
 *  Thread Starter [WebCodePoet](https://wordpress.org/support/users/senjoralfonso/)
 * (@senjoralfonso)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/problem-with-session/#post-16972261)
 * It is still: **Warning**: session_start(): Failed to read session data: redis(
   path: unix:///var/run/redis/redis.sock?persistent=1&weight=1&database=8) in **
   httpdocs/wp-content/plugins/ninjafirewall/lib/utils.php** on line **130**
 *  Plugin Author [nintechnet](https://wordpress.org/support/users/nintechnet/)
 * (@nintechnet)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/problem-with-session/#post-16974921)
 * Log in to WordPress, go to NinjaFirewall > Dashboard: does it show that you are
   whitelisted ?
 *  Thread Starter [WebCodePoet](https://wordpress.org/support/users/senjoralfonso/)
 * (@senjoralfonso)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/problem-with-session/#post-16975263)
 * Hey, I finally fixed it with the helpf of the redis cache plugin developer. The
   error cames as I set the redis path correct in wp-config, but not in php.ini 
   file.
 * /var/run/redis/redis-server.sock
   /var/run/redis/redis.sock

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Problem with Session’ is closed to new replies.

 * ![](https://ps.w.org/ninjafirewall/assets/icon-256x256.png?rev=976137)
 * [NinjaFirewall (WP Edition) - Advanced Security Plugin and Firewall](https://wordpress.org/plugins/ninjafirewall/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ninjafirewall/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ninjafirewall/)
 * [Active Topics](https://wordpress.org/support/plugin/ninjafirewall/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ninjafirewall/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ninjafirewall/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [WebCodePoet](https://wordpress.org/support/users/senjoralfonso/)
 * Last activity: [2 years, 9 months ago](https://wordpress.org/support/topic/problem-with-session/#post-16975263)
 * Status: resolved