Failed to write session data

Hi,

I get these warnings after update to 1.4.4 (it might have also been there in previous versions) . What can I set to change this?

From debug log:

{3178:Thu, 10 Jan 2013 16:23:00 GMT}

WARNING: Unknown: open(/var/lib/php/session/sess_7qtajguvf340qlrih98nu0vic3, O_RDWR) failed: Permission denied (13) in Unknown on line 0

{3178:Thu, 10 Jan 2013 16:23:00 GMT}

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

{3219:Thu, 10 Jan 2013 16:23:11 GMT}

WARNING: session_start() [function.session-start]: open(/var/lib/php/session/sess_7qtajguvf340qlrih98nu0vic3, O_RDWR) failed: Permission denied (13) in /var/www/vhosts/mysite.com/httpdocs/zenphoto/zp-core/functions-basic.php on line 1425

session_start called from zp_session_start (functions-basic.php [1425])

from require_once (admin-globals.php [14])

from admin-logs.php [8]

Comments

  • acrylian Administrator, Developer
    Did you set the option to use sessions instead of cookies? Maybe enable cookies in that case.
  • Ok now I can't login, using cookies option :-(

    How do I restore the db from a backup without loging in?
  • @acrylian Where are the sessions and cookies options or flags stored? Clearly my session setting is causing this like you said.

    In a file or in the DB? If in a file which one/s? Or if in DB which table/s and column/s?

    I looked but can't find it. What I want to do is turn these flags off in the file/s or DB/s because I cannot login. My usr and pwd is correct, but's it is like I'm logged out all the time.

    Error:
    Warning: session_start() [function.session-start]: open(/var/lib/php/session/sess_7qtajguvf340qlrih98nu0vic3, O_RDWR) failed: Permission denied (13) in /var/www/vhosts/mysite.com/httpdocs/zenphoto/zp-core/functions-basic.php on line 1425

    Warning: Unknown: open(/var/lib/php/session/sess_7qtajguvf340qlrih98nu0vic3, O_RDWR) failed: Permission denied (13) in Unknown on line 0

    Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0
  • Update: My ISP changed the functions-basic.php file as follows in line 1425:

    session_start(); -> session_save_path('/tmp');

    Now the session errors are gone, but when I try to login (FF 18.0 with all previous cookies removed) as admin usr, it looks like I log in, because the browser tab heading says "Albums admin: overview", but the login screen just stays there and I see no Overview screen or admin screens.

    -What can I do and what info can I send to help resolve this?
    -Any DB output needed?
    -How can I clean all DB cashe if there are any hanging around?
  • acrylian Administrator, Developer
    The above errors are permission errors meaning the session could not be written. Looks more liek a server config issue as changing Zenphoot core files should neither necessary nor is it recommended.

    I am sadly not familiar with the session and login stuff of Zenphoto. My colleague sbillard handles those. But he is a bit busy otherwise until end of the month generally. So the best is you open a ticket on GitHub with all info so this does not get lost on the forum. Thanks

    Zenphoto has nothing for the db cache to clear. That is a server thing. So any new errors in the logs?
  • Your ISP needs to properly configure PHP sessions. The code they added may well work for you but simply means that they have not configured a workable path for session files. Certainly this is not a generally applicable change--it will work only if there is such a folder available.

    The zenphoto back-end will not work without correctly working sessions, so you have no choice but to get that working.

    Havng done that you can elect to use cookies or sessions for maintaining front end "logon". The difference is that cookies have a duration greater than the brower connection (selectable by the cookie timeout value.) Some people think this is a good thing and some think it is bad. That is a personal choice.
  • @acrylian: Thanks, I raised https://github.com/zenphoto/zenphoto/issues/184 with the latest logs and the functions-basic.php back to the out-of-box ZP 1.4.4.

    @sbillard:

    I totally agree and feel like you stated, my ISP's support actually sucks somewhat. I asked them to fix php session errors and they changed the functions-basic.php file as stated above. My problem is therefore what to ask them to do. eg. What does "properly configure PHP sessions" mean and what is the details?

    The 2nd part to this is that I can NOT get into the ADMIN screens to choose cookies/session. I found these columns "album_session" and "IP_tied_cookies" in the "options" table both set to "0". I do not know what these should be and if this is what you decribed as the maintaining front end "logon".
  • For anywne reading this thread, please see the discussion on the ticket as the thread here is incomplete.
Sign In or Register to comment.