Re: still on sessions
| From: | Martin Clifford | Date: | Fri, 26 Jul 2002 19:32:22 +0000 |
| Subject: | Re: still on sessions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-109860@lists.php.net to get a copy of this message | ||
I always just register an extra variable to track logged in users. If the user has logged in, it is
set to TRUE, if not, FALSE. Then I just do comparisons on that variable.
<?php
session_start()
if($loggedin == FALSE) {
header("Location: login.php");
}
?>
Something along those lines.
>>> "Tyler Durdin" <linuxgeek23@hotmail.com> 07/26/02 03:28PM >>>
alrigh I have switched everything over to the $_Session['variable'] style of
session. Next question, I have a little script that used to check if the
session was registered and if it was not it would redirect to the login
page. How do i accomplish this now that i cannot check if the session is
registered? Here is what i have.
<?
session_start();
if (session_registered("valid_user2')) {
echo " you are registered";
} else {
header("Location: http://loginpage.com");
}
?>
How do I check if a session is active/registered or whatever it is so i cn
still redirect or assign variables?
_________________________________________________________________
Join the world's largest e-mail service with MSN Hotmail.
http://www.hotmail.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php