什么时候开始会话? [英] When to start a session?
本文介绍了什么时候开始会话?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个系统,要求用户先登录(或注册)一个帐户,然后才能访问他们的会员仪表板".
I have a system that requires the user to login (or register) for an account before they are able to access their Member 'dashboard'.
我的问题是……什么时候我 session_start()?在登录页面和注册页面上?还是在用户成功通过身份验证之后?
My question is... at what point so I session_start()? On the login page and the register page? or after the user has successfully authenticated?
谢谢.
推荐答案
您需要在希望会话数据可访问的每个页面上包含 session_start()
.它需要在任何其他输出完成之前调用.
You need to include session_start()
on every page where you want the session data to be accessible. And it needs to be called before any other output has been done.
这篇关于什么时候开始会话?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文