First of all you should backup your current Wordpress installation. Better safe than sorry:-)
Problem:
After updating your Wordpress installation automatically using the link “Please, update your site” that appears in your control panel, although everything seems fine, when you attempt to log in after the upgrade you cannot. You just see the message “You are not authorized to view this page”
Solution:
Searching the web you can find several solutions to this problem (renaming the plugins folder, repairing the database…) but the only solution that worked for me is explained below:
Edit the file wp-config.php that appears in the root folder of your Wordpress installation. Now, you will have to rewrite the Keys section. To do that, go to https://api.wordpress.org/secret-key/1.1/ and copy the keys that it will generate. The keys will be something similar to:
define('AUTH_KEY', '9Xi|*o<9a|Qxyfl$t+YMN?ccV5W,(BqNv=&9zC7!JQ@xxa1Yu8Z|Wn&f{nYcd?3}');
define('SECURE_AUTH_KEY', ',A{As?%s?{[OHsg6@!oWV}AU57*nr|a.6uK/*-.O&23I6Sp9OY4J%]Ud-+@l7G6;');
define('LOGGED_IN_KEY', 'S (O!;2nIjY4vri)I9DY9f2?b!y-;W%iBPf[lSjo e6`l6!uf^_5]qEJN4`mUrm`');
define('NONCE_KEY', ':z,2WO^6DJ}dG#|+i=chn d:s!O-
Once you have done the keys change, save your wp-config.php file and try to log in to your Wordpress control panel again. This time everything should work fine.
You can find the original article (just in Spanish) here
English
Español