Fix WordPress Logging Out Problem

If you encounter a problem with WordPress logging out constantly, you may first try these steps: Deactivate plugins, empty the cache, clear the browser cookies.

Why does WordPress keep logging out?

WordPress sets a cookie in the browser to authenticate the login session. This cookie is set for the WordPress URL defined in the settings section of the admin area. If you are accessing from a URL different than the one in the WordPress settings, then WordPress will not be able to authenticate your session.

wrong

In the example above, the WordPress URL and the Site URL are different (one has www and the other doesn’t). URLs with www and without it are technically two different domains.

How to fix the login Issue

First make sure that you have the same URL in your Site Address and WordPress Address fields in the WordPress settings.
Login to the WordPress dashboard and go to Settings » General.

right

If for some reason you can’t access the admin area, then you can edit the wp-config.php file.
Using an FTP client, locate the wp-config.php file in the root directory. Download the file and open it in a text editor. Add this code above the line That’s all, stop editing! Happy blogging.

define('WP_HOME','http://www.example.com');
define('WP_SITEURL','http://www.example.com');

Or if your website doesn’t have a www.

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

Do you want to build a flawless WordPress site? 

Related Blogs

Web developer
Symfony-PHP-Developer_02
Quick question?