Re: Need help with sessions

From: Date: Wed, 09 Apr 2003 07:34:06 +0000
Subject: Re: Need help with sessions
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-143018@lists.php.net to get a copy of this message
On Tue, 2003-04-08 at 17:57, ODCS wrote: > I must be missing something here as I can not get this to work. I have a > simple login script - if the login is successfull the user is forwarded to > another page, if not he is returned to the login page. > > index.php has the form in it - when the user clicks submit it is sent to > check.php for validation. In check php I have the following. > > if (!session_is_registered("logged")) { // This is the very first thing in > check.php > session_register("logged"); > } > .... more validation code..... > > if the validation is successful - $logged["logged_in"] is set to "True"; > > > Now here is the problem - what do I put in main.php and other pages to > verify that the user is actually logged in. I have tried many variations of > conditional statements, but no matter what I put here I can't get it to > recognize that $logged["logged_in"] is equal to "True". If you haven't tried this ... if (($foo = $_SESSION["logged"] && ($foo["logged_in"]))) { //verified } -- Burhan Khalid phplist[at]meidomus[dot]com Please add a reply-to: header in your messages that points to the mailing list address so that all mail is properly archived and viewed.

« previous php.general (#143018) next »