-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Here is a good session tutorial, maybe it will help you see something your missing.
http://www.sitepoint.com/article/319 - --- Aaron Axelsen AIM: AAAK2 Email: [EMAIL PROTECTED] Want reliable web hosting at affordable prices? www.modevia.com Web Dev/Design Community/Zine www.developercube.com - -----Original Message----- From: Jason k Larson [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 11:15 AM To: Dave Alger Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Sessions You need to make sure that when you are being directed to the other pages that the session name and session id are being passed. Check session.use_trans_sid in the sessions section of phpinfo(). The session name and id are available globally after a session has been started as the constant SID. If you are posting form data, make sure there is an input for the session name with a value of the session id, etc. Hope that helps. - -- Jason k Larson Dave Alger wrote: > Hi All, > > I'm struggling with a session problem and I'm not sure where I > should be looking for the answer. > > Most of my pages begin like this: > ==================================== > > include_once('cfheader.php'); > $feedback = cfHeader("Main Page"); > //Start of page code > ==================================== > The cfheader.php file begins like this: > > ==================================== > <?PHP > session_start(); > function cfHeader($Title,$Protect=false) > { > $feedback=""; > //IF we're loggin on then destory and get new session > if (IsSet($_POST['login'])) > { > include_once('userreg.inc'); > session_destroy(); //Destroy current session before continuing > $feedback =do_login(); > } > if ($Protect==true && !IsSet($_SESSION['name'])) > { > //No Session. > echo "<META HTTP-EQUIV='refresh' content='2;URL=mypage.php'>"; > //Redirect > exit; > } > ==================================== > > > This works fine on my development PC, (PHP v 4.3.1) and on my > primary test site (PHP v4.2.2). However when I try it on the > target site (PHP v4.1.2) then I find that immediately after > starting the session > everything works fine, however when I move to any other page the > session information is lost and I'm redirected to log in again. > > I was looking over the PHPInfo but to be honest I can't see what it > is that's different. > > All help is gratefully appreciated. > > regards, > Dave > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.497 / Virus Database: 296 - Release Date: 04/07/2003 > > > - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -----BEGIN PGP SIGNATURE----- Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com> iQA/AwUBPwru1rrnDjSLw9ADEQJ1BACdHrNZ0thj/W4eCgEhc800ufxhsTQAoLlm TyX4yM46n8VgUMQNQtbwHKC8 =E8V5 -----END PGP SIGNATURE----- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php