Failed to write session data (user)

 
Post new topic   Reply to topic    34SP.com Forum Index // Website Support
View previous topic :: View next topic  
Author Message
lauradoom
34SP Newbie
34SP Newbie


Joined: 17 Nov 2008
Posts: 30
Location: online

PostPosted: Sun Jun 01, 2014 9:51 am    Post subject: Failed to write session data (user) Reply with quote
I am using a custom session handling class which writes to a database. During the last 24 hours, it has failed completely. The following is the only error/warning message I receive:

Warning: Unknown: Failed to write session data (user). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0

Can anyone offer a suggestion as to how I resolve this?

Update: this appears to have been resolved by changing the (local default) session.save_path directive value, even though the class does not use the value passed in the $save_path parameter.

Update update: rewind and confirm that the change in session.save_path has only achieved a change in the error messages, as below:

PHP Warning: Unknown: Failed to write session data (user). Please verify that the current setting of session.save_path is correct (/var/www/vhosts/my_domain/httpdocs/tmp) in Unknown on line 0

Update 1st July 2014

The issue appears to have been caused by the PHP/suhosin interaction when dealing with user-implemented session handling. PHP/suhosin has now been patched and I have had no further errors relating to session handling.


Last edited by lauradoom on Tue Jul 01, 2014 6:52 pm; edited 3 times in total
Back to top
View user's profile Send private message
lauradoom
34SP Newbie
34SP Newbie


Joined: 17 Nov 2008
Posts: 30
Location: online

PostPosted: Sun Jun 08, 2014 9:52 pm    Post subject: Reply with quote
...or this:

08-06-14 22:32:45 construct: Can't connect to MySQL server on '127.0.0.1' (110)
08-06-14 22:28:50 construct: Can't connect to MySQL server on '127.0.0.1' (110)
08-06-14 20:00:21 construct: Can't connect to MySQL server on '127.0.0.1' (110)
08-06-14 19:40:24 construct: Can't connect to MySQL server on '127.0.0.1' (110)
Back to top
View user's profile Send private message
lauradoom
34SP Newbie
34SP Newbie


Joined: 17 Nov 2008
Posts: 30
Location: online

PostPosted: Tue Jun 17, 2014 5:57 pm    Post subject: Reply with quote
Occasional MySQL errors, as above, and intermittent failure to write session data, as above above. Is there a statute of limitations relating to resolution of these issues?
Back to top
View user's profile Send private message
lauradoom
34SP Newbie
34SP Newbie


Joined: 17 Nov 2008
Posts: 30
Location: online

PostPosted: Fri Jun 27, 2014 9:16 am    Post subject: Reply with quote
Support's solution to this problem, which is related to the Suhosin patch trashing user/database custom session handling:

Quote:
In general, saving the sessions in the database isn't great. It is not really designed for that purpose and MySQL serves as a very poor tool for session storage, locking being a key issue - not to mention no built-in support for purging. There's also the fact that this is a shared server and adding this kind of load to the database if the site gets busy will lead to more troubles. Please do try to store them on the file system and let us know there's any further session troubles.


Update 28th June:
the solution above, it now seems, was a temporary measure; since then, a modification/patch has been applied to the suhosin extension, and 18hrs on from that surgery, the custom session handler appears to be holding up without being held up.

Either way, I'll get back to myself/anyone_avidly following_this_epic_saga as it progresses.
Back to top
View user's profile Send private message
Post new topic   Reply to topic    34SP.com Forum Index // Website Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Powered by phpBB © 2001, 2002 phpBB Group