Re: Problems with sessions
| From: | Chris Hewitt | Date: | Tue, 13 May 2003 20:11:44 +0000 |
| Subject: | Re: Problems with sessions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-147487@lists.php.net to get a copy of this message | ||
Toms Liendo wrote:
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? I think your code is assuming register_globals is set to on in php.ini, but you may have it set to off.HTH Chris