Closed olamedia closed 13 years ago
You must better check if session was created or not. When not, $_SESSION will not be saved
I assume you're talking about the HttpSession helper. The HttpFrontController already does a session_start() in the handle() method. This is the intended way to use the HttpSession, with the whole MVC (it wouldn't make much sense to only use the HttpSession and not the rest of the MVC).
This call to session_start() will always start a session, so $_SESSION will always be set.
Did you find any bugs regarding this?
this is not really a bug, but $_SESSION is always accessible from anywhere, global $_SESSION does nothing. Also, using global is a bad practice, just forget about this keyword.
Closed by af812a98447e2c7fd819b0c68baad2c3a8ab6f1b removed global keyword for $_SESSION
I think, your primary language is java, so you just didn't know about this.
Thanks for the tip. I missed that in the manual. The keyword was removed in the last commit.
I lol'd, $_SESSION is a superglobal, using global keyword doesn't make any sense here