如果我不调用 session_start() 会发生什么? [英] What happens if I don't call session_start()?

查看:48
本文介绍了如果我不调用 session_start() 会发生什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我站点中的许多页面作为 HTML 缓存.因此,我将无法在这些页面上调用 session_start().如果您不在每个页面上都调用会话,会话是否有效?

I'm trying to make many of the pages in my site cache-able as HTML. As a result, I won't be able to call session_start() on those pages. Do sessions work if you don't call them on every single page?

推荐答案

如果你不调用 session_start() 那么你将没有 $_SESSION 可用.但是,如果页面是静态 html 文件,那么该页面不需要 $_SESSION,因此您不必担心.

If you don't call session_start() than you won't have $_SESSION available. But if the page is a static html file anyway than you won't need $_SESSION for that page so you don't have to worry about it.

您只在使用 $_SESSION

这篇关于如果我不调用 session_start() 会发生什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆