Family Best Time >> Electronics

How to fix WordPress keeps logout issue

Have you ever come across a frustrating issue where WordPress keeps disconnecting you? Recently one of our users encountered this problem. He followed all the usual troubleshooting tips like disabling plugins, flushing cache, clearing browser cookies, and even restoring WordPress from backups. None of the above worked for her. If you are facing this problem, we have a solution for you. In this article, we will show you how to troubleshoot. WordPress keeps disconnecting issue, also known as WordPress session timeout issue..

Why does WordPress keep disconnecting?

To understand why WordPress keeps logging you out, you need to understand how the WordPress login process works.

WordPress sets a cookie in your browser to authenticate a login session. This cookie is set to the WordPress URL stored in your settings section. If you access from a URL that does not match the one in your WordPress settings, WordPress will not be able to authenticate your session.

How to fix WordPress keeps logout issue

As you can see in the configuration screenshot above, the WordPress URL and the site address are two different URLs (the ad has one page www. and the other does not).

Video Walkthrough

Subscribe to WPBeginner

If you don't like the video or need more instructions, continue reading.

Fixing the login problem

A simple solution to this login issue is to make sure you have the same URL in the Site Address and WordPress Address fields in your WordPress settings. This means that you must choose www or a non-www URL in both fields.

Login to your WordPress dashboard and go to Settings »General .

How to fix WordPress keeps logout issue

If you can't access the admin area, you can update these fields by editing the wp-config.php file.

Connect to your website using an FTP client and locate the wp-config.php file in the root directory of your site. You need to download this file to your desktop and open it in a text editor like Notepad. Add this code right above the line That's it, stop editing! Happy blogging.

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

If you prefer to use www in URL, use this code instead

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

Don't forget to replace example.com with your own domain name.

Why does this solution work?

Technically speaking, www is a subdomain itself. This means that URLs with and without www are actually two different domains.

Changing and updating the URLs to the same address will fix the problem.

A more detailed technical explanation of www vs bare domain is here.

It is also important to note that incorrect settings in the Site Address and WordPress Address fields can also result in too many redirect issues in WordPress.

We hope this article helped you to fix WordPress session timeout issue. If not, check how to fix WordPress login page refresh and redirect issue.

If you enjoyed this article, please subscribe to our WordPress YouTube Channel video tutorials. You can also find us on Twitter and Google.+.