Answers:
它使用裸cookie并存储登录状态信息客户端。
wordpress_7339a175323c25a8547b5a6d26c49afa =您的用户名%7C1457109155%7C170f103ef3dc57cdb1835662d97c1e13;
盐在您的wp-config.php文件中:
/**#@+
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
*
* @since 2.6.0
*/
define('AUTH_KEY', 'put your unique phrase here');
define('SECURE_AUTH_KEY', 'put your unique phrase here');
define('LOGGED_IN_KEY', 'put your unique phrase here');
define('NONCE_KEY', 'put your unique phrase here');
define('AUTH_SALT', 'put your unique phrase here');
define('SECURE_AUTH_SALT', 'put your unique phrase here');
define('LOGGED_IN_SALT', 'put your unique phrase here');
define('NONCE_SALT', 'put your unique phrase here');
身份验证cookie,其名称存储在AUTH_COOKIE内部,该身份验证cookie是通过将“ wordpress_”与default-constants.php中设置的siteurl的md5总和连接而成的。这是默认行为,可以通过预先设置一些常量从配置文件中覆盖。
身份验证cookie是用户名的串联,身份验证cookie有效之前的时间戳,以及HMAC,这对于立即拔出TL; DR的用户来说是一种键偏移哈希。这三个变量与管道字符|连接。
这是HMAC的构造方式:
$hash = hash_hmac('md5', $username . '|' . $expiration, wp_hash($username . substr($user->user_pass, 8, 4) . '|' . $expiration, $scheme));
根据这篇文章,此答案中的大多数信息都来自于黑客,如果他们知道您的唯一短语是什么,那么黑客将在一周内发出每秒30个请求,如果您的密钥是唯一的,则要花费200,000,000,000,000,000,000,000,000,000,000,000,000倍。
Cookies只是会话数据的客户端存储... WordPress Cookies
实际上,没有会话的人可以拥有cookie,但是没有cookie的人则不能拥有会话。
session_start()
显式使用在页面顶部启用会话。现在,显然,wordpress session_start()
的核心没有任何内容。看到您最近的评论让我感到困惑吗?