PHP - Set session within a function -
found (I think ...) a very simple problem:
I set a session Simple position within the Function Function:
I have received a login form After reducing the form, I call a function "login" which checks whether the user has been authenticated or No. If so, then a session should be set.
Here are some very simple code:
session_start (); Function Login () {$ session ['login'] = true; } If (isset ($ _ request ['dologin'])) {login (); // session has been set here, it works ...} if ($ session ['login'] === correct) 'you are logged' echo;
But why does not it work? Thank you so much!
You are using $ session
, code> $ _ session
Comments
Post a Comment