1

[Note: I'm keeping the following opening paragraph here for posterity, but this is no longer a session issue - something wrong on the server is preventing CSS from displaying.]

I asked this question on the Wordpress forum, but I seemed to have stumped those folks, so I'll try here. Wordpress clearly handles sessions (in particular, recording that a given browser is logged into a site) differently than PHP in general, and after a server update, I'm having some sort of file permission problem, so I need to find where on the server Wordpress saves files related to its sessions or authentication status. Does anyone know?

The symptoms in my case are two-fold (at least): (1) It always says my session is expired, even right after I log in; (2) There is no styling on the backend - apparently /wp-admin/load-styles.php also requires authentication.

Update: Perhaps symptom #2 is the only symptom. I just discovered that in spite of the "Session expired. Please log in again..." message at the bottom of every page, I can continue to do things without logging in again. Also, at the bottom of the list of themes (which indeed shows three themes) is "No themes found. Try a different search." followed by the "Session expired" bit. So perhaps those things would not be showing if CSS was working, meaning that the problem is only the styles. I disabled all plugins and switched my theme to TwentySixteen, but there was no change in the behavior. I was not using Wordpress when it stopped working - the only thing I did was update my server.

So, if the styles might be the only problem, how do I find out what is preventing /wp-admin/load-styles.php from working?

Update 2: I decided to test Milan's theory that the markup of the "Session expired" would only be produced if something is wrong. On a healthy site, I logged in and then looked at the source code of the dashboard. The following markup is indeed present:

<div id="wp-auth-check">
<button type="button" class="wp-auth-check-close button-link"><span class="screen-reader-text">Close dialog</span></button>
        <div id="wp-auth-check-form" class="loading" data-src="http://[redacted].com/wp-login.php?interim-login=1"></div>
        <div class="wp-auth-fallback">
    <p><b class="wp-auth-fallback-expired" tabindex="0">Session expired</b></p>
    <p><a href="http://[redacted].com/wp-login.php" target="_blank">Please log in again.</a>
    The login page will open in a new window. After logging in you can close it and return to this page.</p>
</div>

So that markup is always present, but hidden by CSS until it is needed. If I could get my CSS to work, I think all would be well. But I cannot find any clues in log files as to what the problem is - troubleshooting suggestions are welcome.

4
  • There are no session files, authentication is all cookie-based.
    – Milo
    Oct 4, 2017 at 12:59
  • I learned more - apparently I am logged in - see the update to my question. Oct 4, 2017 at 16:36
  • @Milo Oops, I forgot to add your name to my previous comment - the point of the comment was to notify you that I updated the question. Oct 5, 2017 at 1:21
  • After further investigation, I discovered that the content served by load-styles.php would go to the browser until 46,140 bytes had been sent, and then it would abruptly stop. If I change the load[] array in the URL to load different things first, it would still only send 46,140 bytes. I have no idea why. But I decided to just add define('CONCATENATE_SCRIPTS', false); to wp-config.php as a bandaid and not wrestle it further for now. Oct 7, 2017 at 13:38

1 Answer 1

0

WordPress doesn't use sessions. User authentication is done with cookies. But, there are many plugins that use sessions for some purpose, and it is possible that you are using one (or even more) plugin that is using sessions. You should try to determine which plugin does that and start from there. Search for the session_start() function to find which plugin uses it. You need to either update the plugin or if the problem is not solved, to replace it or contact plugin author for help.

As for the issue with load-styles.php, it might go aways once you solve sessions problem first.

9
  • I had already fixed the PHP sessions problem before I started fighting this, so if plugins use PHP sessions, they would be fine. Anyway, I just discovered that apparently I am logged in, so I need to focus more on the styles issue - see the update to my question. Oct 4, 2017 at 16:39
  • It doesn't look like the sessions problem is fixed since you are getting the same message, and it looks like that plugin that is causing that is still having problems. As for the load-styles.php file, you should check server logs to see what types of messages you get, and what can be causing that file to fail loading. It could be the server configuration issue. Oct 4, 2017 at 18:58
  • I'm not sure what you mean by "that plugin" - I turned off all plugins, and it acted exactly the same way. As for the server logs, I totally agree, but before I wrote to the WP forum three days ago, I searched and searched for a log file that would hint at what was going wrong. Just now I did a controlled test where I accessed the WP backend a couple times and then immediately checked the logs, but there was nothing that new in journalctl or any of the files under /var/log. Oct 5, 2017 at 1:13
  • If you see session expired message, something has to be causing that. WordPress on his own can't cause session expired messages because it doesn't use sessions or any of the session related functions. Have you talked to your hosting company support, maybe they can shed some light on the problem? Oct 5, 2017 at 7:20
  • This is an unmanaged cloud VPS - my hoster (Linode) has nothing to do with it. Wordpress (and most everything else) was working fine until I did a yum update that updated the OS and a lot of packages, including nginx and php-fpm. Normally updates are harmless, but... Oct 5, 2017 at 9:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.