we got 4 pages
index.php-login.php-access1.php-access2.php
you go at index if you have not login head will be login php
but when yu login what you do after?
you start a session and sett session username and session password
when you go at the access 1.php you can make an if stament and see if your data username and password have been set?
or you must using get function variables at every function and if they are in database then you go on?
Sessions how they works?
Moderator: General Moderators
Re: Sessions how they works?
It is hard to understand what you are saying or asking. Session variables are stored and accessed on the server, and can only be used by a user during a single browsing session. $_SESSION is a superglobal array that can be accessed anywhere in your code without re-declaring it. You can certainly set the user's username and password as a session var, but you may still want to validate it against your user table on each page load to be sure. You can use isset() to check if the variables have been set. Check out the PHP Manual for Sessions for lots of good info.