RE: [PHP] Re: Problem with sessions.(Again Sorry :)

From: Date: Sun, 21 Jul 2002 14:57:47 +0000
Subject: RE: [PHP] Re: Problem with sessions.(Again Sorry :)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-108725@lists.php.net to get a copy of this message
> -----Original Message----- > From: Richard Lynch [mailto:rich@phpbootcamp.com] > Sent: Sunday, July 21, 2002 1:05 AM > To: php-general@lists.php.net > Subject: [PHP] Re: Problem with sessions.(Again Sorry :) > > >I have a login script which calls this function if it is a proper user > etc. > > > >function register_in_session($uinfo){ > >// Used in conjuction with validate to input user info into the session > > $_SESSION['uid'] = $uinfo[0]; > > $_SESSION['gid'] = $uinfo[1]; > > $_SESSION['banid'] = $uinfo[2]; > > $_SESSION['username'] = $uinfo[3]; > > $_SESSION['fname'] = $uinfo[4]; > > $_SESSION['lname'] = $uinfo[5]; > > $_SESSION['email'] = $uinfo[6]; > >} > > Don't cram things into $_SESSION. Use this: > > session_register('uid'); > global $uid; > $uid = $uinfo[0]; With PHP 4.2, you don't have to use session_register. You can do it exactly like the OP is. I do it all the time. Whether that is a "feature" or a bug, I don't know. ---John Holmes...

« previous php.general (#108725) next »