session_create_id 和 session_regenerate_id() 有什么区别? [英] What is the difference between session_create_id and session_regenerate_id()?
问题描述
医生说
session_create_id()
用于为当前会话创建新的会话 ID.session_regenerate_id()
使用新生成的会话 ID 更新当前会话 ID.
session_create_id()
is used to create new session id for the current session.
session_regenerate_id()
Update the current session id with a newly generated one.
这两个函数有什么区别吗?
Is there any difference between these two functions ?
推荐答案
是的,有区别,session_create_id()
会创建一个新的 sessionId 丢弃当前的 $_SESSION
信息,其中 session_regenerate_id()
不会破坏它们,而只是更新 sessionId
Yes there is a difference, session_create_id()
will create a new sessionId discarding the current $_SESSION
information, where as session_regenerate_id()
doesn't destroys them, instead it just updates the sessionId
引用自:http://php.net/manual/en/function.session-create-id.php &http://php.net/manual/en/function.session-regenerate-id.php
这篇关于session_create_id 和 session_regenerate_id() 有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!