简体   繁体   中英

When to use session_start()?

我已经经历了一些$_SESSION例子,我有点糊涂了,我应该使用session_start()每次在我访问,或者设置$_SESSION['variable']或者我应该只使用session_start()每页一次或用户成功登录后就可以了吗?

在计划使用任何$ _SESSION变量之前,请在每页顶部使用一次

如果要访问$_SESSION所有会话,则应始终在PHP页面的First Line使用一次session_start()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM