Problems with sessions
| From: | Tom�s Liendo | Date: | Tue, 13 May 2003 19:47:03 +0000 |
| Subject: | Problems with sessions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-147482@lists.php.net to get a copy of this message | ||
Hi people, I need your help:
I don't understand sessions very well. I'm programming a typical login
system. The user input his user name and password, and I check this
information in a MySQL database. If the user and password exists, I do the
following:
session_start();
session_register("authenticated");
$authenticated="yes";
Then, the user has a menu (made with Flash) and can go to diferents pages
(each page is a diferent php file). In each one of those pages I check that
the user is authenticated:
if($authenticated!="yes")
{
echo "Login error";
}
else
{
...
But $authenticated never has the value yes. I suppose that this is because
the $authenticated doesn't conserve the value between pages, but this the
characteristic of a session variable. Or not?
Ahead of time, thank you very much,
Tom.