我正在 MySQL 数据库中创建一个表来保存一些 session 数据,包括 session_id
。存储 session_id
字符串的 VARCHAR
的长度应该是多少?
最佳答案
取决于 session.hash_function和 session.hash_bits_per_character .
查看 session_id页面了解更多信息。
The higher you set session.hash_bits_per_character the shorter your session_id will become by using more bits per character. The possible values are 4, 5, or 6.
When using sha-1 for hashing (by setting ini_set('session.hash_function', 1) the following session string lengths are produced by the three session.hash_bits_per_character settings:
4 - 40 character string
5 - 32 character string
6 - 27 character string
关于php - PHP session ID 字符串的长度是多少?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12240922/