How would I create a session in a PHP class?
I'm trying to start a session in one class, and assign various values. In the next class I'm trying to obtain the results of that session? But it's not working what sh开发者_高级运维ould I do?
Impossible to say for sure without code of course, but most common error is forgetting to start your code with:
session_start()
Keep this in mind: (as hinted in the comments by @julioc )
To use cookie-based sessions, session_start() must be called before outputing anything to the browser.
精彩评论