Tutorials Web Development

How to Fight That Nasty ‘Session Expired’ Error?

4.67/5 (3)

We are happy to present you a new WordPress hack that will eleminate once and for all "Session expired" error.

Follow these simple steps and we make sure you will never see this again!

You will need to edit your Theme Functions file, (functions.php) , it should be located in wp-content/themes/your_theme_ name folder on the server.

You can also edit this file from WordPress Dashboard, just navigate to Appearance > Editor.

The following code should be added to file:

	add_filter( 'auth_cookie_expiration', 'keep_me_logged_in_for_1_year' ); function keep_me_logged_in_for_1_year( $expirein ) { return 31556926; // 1 year in seconds }

In our case, 31556926 is 1 year in seconds , you can change the value to your own .

Save your changes to file when you are done.

You have successfully extended the login session on your WordPress bases site.

Have a nice day. More hacks are coming;)

Subscribe to our daily WordPress hack-o-letter!

Don't miss your next WP Hack

2 Responses

Leave a Reply

Your email address will not be published. Required fields are marked *