php - PHP session ID 字符串的长度是多少?

标签 php mysql session sessionid

我正在 MySQL 数据库中创建一个表来保存一些 session 数据,包括 session_id。存储 session_id 字符串的 VARCHAR 的长度应该是多少?

最佳答案

取决于 session.hash_functionsession.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/

相关文章:

java - 如何防止 session 属性在服务器上持久化?

php - 在没有网络服务器的情况下在 linux 上使用 php 从文件夹发送电子邮件

php - 在 codeception 中设置用户代理

mysql - 如何在没有聚合函数的情况下按公共(public)值分组并获得所有不同的值

java - 为什么这个 PBKDF2 函数每次都会输出不同的哈希值

c# - 如何将表数据存储在不会被删除的变量中

javascript - 下拉列表中的多项操作

javascript - Angular 认证

java - 保存 Activity 的实例状态以保持用户登录?

javascript - 无法检索在 servlet 中设置的值