0

I have a Wordpress site set up and have recently started receiving the following PHP warnings at the bottom of the page below the footer.

Warning: Unknown: open(/tmp/sess_ae2e58214af1e2f1d14b233cb766e105, 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 () in Unknown on line 0

Here is what I do know. I created a Wordpress site on a localhost using MAMP and copied the local database to a production environment.

EDIT: This issue is not able to be reproduced faithfully. At one point the warnings were only in chrome, currently they are showing is Safri, but not in both browsers at the same time. I have verified that the /tmp/ folder at the root of the server IS writeable.

HOSTING UPDATE: The hosting company is reporting that there are conflicting session files from similar user names (all wordpress installations we have set up have an "Admin" user).

The suggested solution is to have each installation write session files to its own directroy within the FTP for that site and not to the root of the server.

Any help is appreciated.

MagRat
  • 308
  • 7
  • 23
  • That error has NOTHING to do with your browser, and everything to do with server configuration. – Marc B Oct 03 '13 at 21:52
  • I was fairly sure that was the case. I am not sure why the Warnings only show up for me in Chrome. I am guessing it is the difference between the localhost setup and the production environment, but I do not know where to being to fix this issue. – MagRat Oct 03 '13 at 21:56

2 Answers2

0

Check your production environment /tmp/ folder permissions or ask your hosting coy for more details.

  • I do not see a _/tmp/_ folder within the Wordpress installation. Would this be the _/tmp/_ folder at the root of the FTP? – MagRat Oct 04 '13 at 14:54
  • No this folder will not be in the wordpress install. The /tmp/ folder is a folder that stores all the session data. This is something you do not get access to via FTP. If you do not have shell access ask your hosting company to make the folder writable and try check your server config. – Jacob Sonoftheweb Ekanem Oct 06 '13 at 23:14
  • We have checked the _/tmp/_ file at the root of the server and verified that the directory is writeable. – MagRat Oct 10 '13 at 15:47
  • Look at these links: http://stackoverflow.com/questions/5104065/php-session-handling-errors http://www.linuxquestions.org/questions/linux-server-73/warning-unknown-open-tmp-sess_xxxxxxxxxx-o_rdwr-failed-permission-894678/ – Jacob Sonoftheweb Ekanem Oct 11 '13 at 13:59
0

Before start session, check if the file of session is writable and, if not, delete the cookie:

session_save_path("/tmp");
if (isset($_COOKIE[session_name()])) {
    if(!is_writable("/tmp/sess_".$_COOKIE[session_name()])) {
        setcookie(session_name(), '', time()-42000, '/');
        header("Location: ./");
    }
}
session_start();