今天我在采访中被问到
如果浏览器不支持 cookie,PHP 如何维护会话?
选项是....
1. using an MD5 hash of the user's email address as the session identifier
2. using the browser's network address as the session identifier
3. including the session identifier as a parameter every GET and POST request
4. using the "secure cookie" header to force the browser to set a cookie
Run Code Online (Sandbox Code Playgroud)
谁能告诉我哪个是准确的,请简要说明一下?
正如我们在评论中所讨论的那样 - 2 个答案有意义,2 个没有意义。
建议的答案是 2 和 3 组合(如果您只能选择一个,则为 3),存储由 IP 地址标识的会话,URL 中带有 unix 时间戳以区分用户。