简体   繁体   English

PHPSESSID是如何生成的?

[英]How is the PHPSESSID generated?

Psudeocode or PHP code desirable. Psudeocode或PHP代码是可取的。 References even better on the components and procedures to generate the PHPSESSID manually. 在手动生成PHPSESSID的组件和过程中更好地参考。

The code that generates the sssion ID is here - but it's C, since that's how PHP itself is implemented. 生成sssion ID的代码在这里 - 但它是C,因为这就是PHP本身的实现方式。

Basically, it uses a cryptographic hash function and as input the remote IP address, the current time and some other stuff. 基本上,它使用加密哈希函数并输入远程IP地址,当前时间和其他一些东西。

The hash function to use and optionally a source of additional entropy can be configured in php.ini . 可以在php.ini中配置要使用的哈希函数和可选的附加熵源。

它是远程地址和当前时间的散列,在ext / session / session.c:344( php_session_create_id() )中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM