Howdy all,
I'm making an authentication script using sessions variables, but the varible seems to disappear when trying to access it from another page.
A simple form on the home page takes a user name and password, it then goes to an authentication page. The authenticate page is making a match and setting the session variables. I have tested this part and know that for sure. The authentication page then redirects in 2 seconds back to the originating page by a meta refresh. In this case, its the index page, but the index page does not recognize the session variable. Here is the code on the index page:
[B]if[/B] [B]($_SESSION[[/B]"authenticated"[B]]==[/B]"YES"[B])[/B]
[B]{[/B]
echo "Hi " [B].$_SESSION[[/B]"user_name"[B]];[/B]
[B]}[/B]
[B]else[/B]
[B]{[/B]
?>
HTML form code here.
<?php
[B]}[/B]
?>
It supposed to acknowledge the user, or put the log in form on the page, but it doesn't recognize the varible. Can anyone help? I've googled and looked at the code over and over, but can't see anything wrong.
Also, I'm using PHP 4.2.?, so I should not have to register the session variables as recommended for version 4.1 and above, correct?
Thanks,
Gil