让wordpress2.5的小甜饼干更安全

WordPress 2.5的wp-config.php中增加了一个常量SECRET_KEY,它使你的cookie能更好地抵御SQL注入或其他攻击。

如果你的wp-config.php是WordPress2.5版的,它应该有下列一段:

  1. // Change SECRET_KEY to a unique phrase. You won’t have to remember it later,
  2. // so make it long and complicated. You can visit https://www.grc.com/passwords.htm
  3. // to get a phrase generated for you, or just make something up.
  4. define('SECRET_KEY', '唯一字符串'); // Change this to a unique phrase

你需要做的只是把上面的“唯一字符串”改成你想要的字符串就行了。

如果你想我一样wp-config.php老旧不堪,你只需在其中加入下面一句,也就可以了(当然也要改那个字符串啦):

  1. define('SECRET_KEY', '唯一字符串');

如果你对那个“唯一字符串”没有什么更好的想法,wordpress也为你想到了,访问api.wordpress.org/secret-key/1.0/,将之生成的覆盖上面的define语句。

提供个偶尔发现的小工具:

阅读:Cookie Security in WordPress 2.5

收藏到: 收藏到del.icio.us | 收藏到baidu搜藏 | 收藏到diglog | 收藏到饭否 | 收藏到Google | 收藏到新浪vivi | 收藏到mister wong | 收藏到挖客 | 收藏到qq书签