sessions

From: Date: Fri, 13 Oct 2000 01:37:05 +0000
Subject: sessions
Groups: php.general 
Request: Send a blank email to php-general+get-19927@lists.php.net to get a copy of this message
I am struggling to better understand sessions. I am building a website and using php and MySql for user authentication. I have two tables. One for users storing their usernames and passwords etc. and another table called admin where I have a list of administrators' passwords. I am using sessions to keep track of users on the site and it works fine. Now I want to do the same thing with the admin section. But it won't authenticate even though the logic is exactly the same just the name of the table it gets data from is different. My question is can you use sessions in this manner. If so how? I tried doing session_start(); session_register ("session"); function cleanMemberSession ($id, $username, $password) { global $session; $session[id] = $id; $session[username] = $username; $session[password] = $password; $session[logged_in] = true; } for users which works great. And,... session_start(); session_register ("session2"); function cleanMemberSession ($id, $login, $password) { global $session2; $session2[id] = $id; $session2[login] = $login; $session2[password] = $password; $session2[logged_in] = true; } for admin which doesn't work. does anyone know whether or not you can do this. and have any examples of how. thanks, rodney

« previous php.general (#19927) next »