{"id":3110,"date":"2008-04-26T23:10:53","date_gmt":"2008-04-26T17:40:53","guid":{"rendered":"https:\/\/www.quickonlinetips.com\/archives\/?p=3110"},"modified":"2014-12-17T17:29:12","modified_gmt":"2014-12-17T11:59:12","slug":"wordpress-secret-key-for-secure-cookies","status":"publish","type":"post","link":"https:\/\/www.quickonlinetips.com\/archives\/2008\/04\/wordpress-secret-key-for-secure-cookies\/","title":{"rendered":"Add WordPress SECRET_KEY for Secure Cookies"},"content":{"rendered":"<p>WordPress 2.5 has incorporated a cool feature for better cookie security. You can add a <strong>SECRET_KEY<\/strong> to the wordpress wp-config.php file and make cookies secure against attacks where someone has hacked into your database via an SQL injection exploit etc.<\/p>\n<p>Check the latest sample <strong>wp-config-sample.php <\/strong>file and you will see this new line which advises you to add a SECRET_KEY. They advise it can be long and incomprehensible as you just need to cut paste it and forget it.<\/p>\n<p>Visit <a href=\"http:\/\/api.wordpress.org\/secret-key\/1.0\/\" target=\"_blank\" rel=\"nofollow noopener\">api.wordpress.org\/secret-key\/1.0\/<\/a> which will <strong>auto-generate a unique secret key<\/strong> everytime. Simply cut and paste and add it to your wp-config.php file. Get a different secret for each of your blogs. Here is how the key looks like when added to your wp-config.php file.<\/p>\n<p><code>define('SECRET_KEY', 'YOUR_LONG_CODE');<\/code><\/p>\n<p>Ryan elaborates that don&#8217;t memorize this long code as you just need to paste and forget it. They will not ask for it again. If you ever need to <strong>force all users to log out<\/strong>, simply change the SECRET_KEY. Note that changing SECRET_KEY will affect only login cookies.<\/p>\n<p>I have been upgrading WordPress since WP 1.5 days, and in my wp-config.php, it was missing. I simply generated a SECRET_KEY and added it to my wp-config.php file. Hooray for better blog security. Hooray for WordPress 2.5.1<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress 2.5 has incorporated a cool feature for better cookie security. You can add a SECRET_KEY to the wordpress wp-config.php&#8230;<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[6,7],"tags":[49,17],"class_list":["post-3110","post","type-post","status-publish","format-standard","hentry","category-blogging","category-security","tag-tutorials","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/3110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/comments?post=3110"}],"version-history":[{"count":0,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/3110\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media?parent=3110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/categories?post=3110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/tags?post=3110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}