怎样修改wordpress cookie名称,wordpress_test_cookie wordpress_logged_in

雷小白 2022-6-29 1245


怎样修改wordpress cookie名称,wordpress_test_cookie wordpress_logged_in 可以在wp-config.php添加代码

// Here we just simulate how it's done in the core

define( 'COOKIEHASH',           md5( 'https://chuihu.com' )    ); 

// Then we override the cookie names:
define( 'USER_COOKIE',          'chuihu_com_user_'     . COOKIEHASH );
define( 'PASS_COOKIE',          'chuihu_com_pass_'      . COOKIEHASH );
define( 'AUTH_COOKIE',          'chuihu_com_'           . COOKIEHASH );
define( 'SECURE_AUTH_COOKIE',   'chuihu_com_sec_'       . COOKIEHASH );
define( 'LOGGED_IN_COOKIE',     'chuihu_com_logged_in_' . COOKIEHASH );
define( 'TEST_COOKIE',          'chuihu_com_test_cookie'             );


PHP 5.6+ :


// Then we override the cookie names:
const USER_COOKIE        = 'chuihu_com_user_'      . COOKIEHASH;
const PASS_COOKIE        = 'chuihu_com_pass_'      . COOKIEHASH;
const AUTH_COOKIE        = 'chuihu_com_'           . COOKIEHASH;
const SECURE_AUTH_COOKIE = 'chuihu_com_sec_'       . COOKIEHASH;
const LOGGED_IN_COOKIE   = 'chuihu_com_logged_in_' . COOKIEHASH;
const TEST_COOKIE        = 'chuihu_com_test_cookie';


推荐阅读
  1. 咖啡已成为很多人生活中不可或缺的一部分~顶刊「Science」上数据统计显示,全世界平均每天要消耗22.5亿杯咖啡,杯子连起来简直能绕地球7.5圈。虽然中国全国范围内的人均咖啡饮用杯数仅为9杯/年,但在一二线城
  2. 结直肠癌是美国第三大常见癌症,在过去二十年中,年轻人的发病率一直在上升。结直肠癌包含两种癌症:结肠癌和直肠癌,前者起病于大肠,后者起病于大肠的末端,称为直肠。  梅奥诊所胃肠病专家 Derek E
    梅奥诊所:结直肠癌的预防与筛查, 如何降低患结直肠癌风险
最新评论 (0)

Copyright © 2024 chuihu.com

京ICP备15036784号-5

T: 0.010, S: 16