Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is the PHPSESSID generated?

Tags:

php

Psudeocode or PHP code desirable. References even better on the components and procedures to generate the PHPSESSID manually.

like image 737
JavaRocky Avatar asked Apr 06 '10 12:04

JavaRocky


1 Answers

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.

like image 106
Michael Borgwardt Avatar answered Sep 29 '22 12:09

Michael Borgwardt