Psudeocode or PHP code desirable. References even better on the components and procedures to generate the PHPSESSID manually.
+7
A:
The code that generates the sssion ID is here - but it's C, since that's how PHP itself is implemented.
Basically, it uses a cryptographic hash function and as input the remote IP address, the current time and some other stuff.
The hash function to use and optionally a source of additional entropy can be configured in php.ini.
Michael Borgwardt
2010-04-06 12:25:48
That is not C++, its C.
Tim Post
2010-04-06 12:27:17
@Tim: Ah, right. I saw some -> in there and wasn't aware that C uses that operator as well.
Michael Borgwardt
2010-04-06 12:35:52
+1 for correcting and indicating it can be salted in php.ini :)
Tim Post
2010-04-06 12:45:15
+4
A:
It's hashed from the remote address and the current time, in ext/session/session.c:344(php_session_create_id()).
Ignacio Vazquez-Abrams
2010-04-06 12:27:28