this is my first time using sessions and I am struggling
I have a password form, when the password is entered correctly I do this:
session_start();
$_SESSION['pw'] = $pw;
at the top of the page I have this:
if ( isset($_SESSION['pw']) ) {
echo 'logged';
$tbs_logged = 1;
} else {
echo 'NOT logged';
$tbs_logged = 0;
}
Somehow every time I reload the page (without closing the browser and without letting hours go by) it always says I am NOT logged...
What am I doing wrong?
Thanks