Have you ever encountered this very frustrating problem where WordPress keeps logging out of the Admin session! automatically?
I had this peculiar problem for a while. I log in to my WordPress admin dashboard, check for any comments or updates. But when I click the back button, I’m already logged out.
My browser says “Can not find the URL”. or session expired please login again error in WordPress. That was very intriguing and problematic.
I tried deactivating plugins, emptying cache, clearing browser cookies, and even restoring WordPress from backups. But none of the above worked.
If you are facing this issue WordPress Keeps Logging Out Of Admin Session. Here is a very simple solution.
Why WordPress Keeps logging out of Admin Session?
In order to understand why we get logged out of the WordPress admin session, we need to understand how the WordPress login process work.
WordPress sets a cookie in your browser to authenticate a login session. This cookie is set for the WordPress URL stored in your settings section.
But if we are accessing from a URL that does not match the one in your WordPress settings, then WordPress will not be able to authenticate that session. So for security WordPress logs you out for that session.
See the screenshot below. It’s my WordPress admin dashboard. Can you detect the problem here?
I had two different URLs for the same site. WordPress Address URL is a non-www, but the Site Address URL is www. That was the problem, why I was getting logged out of WordPress admin session.
You may like to know 10 ways to speed up your WordPress site in few minutes.
Fixing Login Issue: Logged out of WordPress admin session:
A very simple fix for this Getting logged out of WordPress admin session issue, is to make sure that you have the same URL in your site address and also WordPress Address fields, in your WordPress settings.
This also means you need to choose either www or non-www in both the URL fields.
Procedure:
See also How To Fix WordPress HTTP Error While Uploading Images
First, log in to your WordPress dashboard. Under Settings in the left panel > go to the General settings page, as shown in the image.
Here make sure that both the WordPress Address URL and Site Address URL are the same. For example, both fields should either be http://www.yoursite.com or http://yoursite.com.
After making the changes, save your settings, and log out. See the image below.
Clear your browser cache, or sites cache if you are using any WordPress cache plugin, like wp super cache or w3 total cache.
The problem of WordPress keeps logging out should be gone (solved).
The above screenshot is my web site setting. You can use www or non-www URL. The choice is yours. It does not really make any difference, as long as both fields are the same.
Why This simple solution Work and How?
Well technically www (world wide web) by itself is a sub-domain. This means URLs with www prefix and URLs without being treated as two different domains.
So by changing the URLs in both the fields to the same address and updating, fixes the issue.
Hello! I am Ben Jamir, Founder, and Author of this blog Tipsnfreeware. I blog about computer tips & tricks, share tested free Software’s, Networking, WordPress tips, SEO tips. If you like my post /Tips then please like and share it with your friends.