note 69073 added to function.session-id
| From: | php-general at lists dot php dot net | Date: | Tue, 22 Aug 2006 08:15:04 +0000 |
| Subject: | note 69073 added to function.session-id | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-116157@lists.php.net to get a copy of this message | ||
In response to simon at quo dot com dot au:
The PHPSESSID is produced using an hash function. By default, it uses MD5 which produces 128 bits
long (i.e: 16 bytes long) hashes.
But, since some bytes' values may not be used in the HTTP header, PHP outputs the hash in its
hexadecimal representation, thus resulting in a 32 bytes long text.
Starting with PHP 5.0, you can change the hash function used (by setting
"session.hash_function" to whatever function you want to use in php.ini).
You may for example set it to 1 to switch to SHA-1 which produces 160 bits (20 bytes) long hashes.
Please also note that another setting was introduced in PHP 5 (session.hash_bits_per_character)
which sort of "compresses" the hash. Thus, resulting in what seems to be a shorter hash.
This feature helps you improve your application's security by producing IDs that are harder to
prodict for a malicious attacker.
More information on those settings is provided on:
http://www.php.net/manual/en/ref.session.php
----
Server IP: 217.174.203.10
Probable Submitter: 89.159.49.177
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.session-id.php
Edit -- https://master.php.net/note/edit/69073
Del: integrated -- https://master.php.net/note/delete/69073/integrated
Del: useless -- https://master.php.net/note/delete/69073/useless
Del: bad code -- https://master.php.net/note/delete/69073/bad+code
Del: spam -- https://master.php.net/note/delete/69073/spam
Del: non-english -- https://master.php.net/note/delete/69073/non-english
Del: in docs -- https://master.php.net/note/delete/69073/in+docs
Del: other reasons-- https://master.php.net/note/delete/69073
Reject -- https://master.php.net/note/reject/69073
Search -- https://master.php.net/manage/user-notes.php