CodeIgniter Forums
session_write_close(): Failed to write session data using user defined save handler - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: session_write_close(): Failed to write session data using user defined save handler (/showthread.php?tid=80404)



session_write_close(): Failed to write session data using user defined save handler - matrox445 - 10-27-2021

Hello,

I want to allow concurrent requests from a client for simultaneous AJAX calls. 
In each php function called, I start my code with session_write_close() to unlock the session. But I randomly get this message : 

Code:
session_write_close(): Failed to write session data using user defined save handler.

I'm using redis and everything work fine. Just getting this message sometimes in my logs.

Any idea?
Cheers


RE: session_write_close(): Failed to write session data using user defined save handler - InsiteFX - 10-28-2021

Read the user comments here:

PHP.net - session_write_close

It seems that the output buffering is causing session problems on php 7+


RE: session_write_close(): Failed to write session data using user defined save handler - matrox445 - 10-28-2021

Oh, nice catch ! I will try to disable it and see what happend Smile
Thanks for your answer


RE: session_write_close(): Failed to write session data using user defined save handler - matrox445 - 11-10-2021

(10-28-2021, 01:34 AM)InsiteFX Wrote: Read the user comments here:

PHP.net - session_write_close

It seems that the output buffering is causing session problems on php 7+

Well, I set output buffering = off in php.ini but it doesn't solve the problem. I still get "Failed to write session data using user defined save handler" randomly.

I find this thread on stackoverflow : https://stackoverflow.com/questions/34117651/php7-symfony-2-8-failed-to-write-session-data
Not sure if the selected answer can apply to codeigniter ? I'm using Redis.